{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "cdccbc07-82dc-4f38-971d-9ec30f594a13",
   "metadata": {},
   "source": [
    "# Rational Function Initialization\n",
    "\n",
    "Creating initial coefficients to approximate arbitrary functions for rational functions\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "54ead0d7-dcd1-4124-b35e-2d5b85658556",
   "metadata": {
    "jupyter": {
     "source_hidden": true
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t- Added replace rule for module \"github.com/gomlx/gopjrt\" to local directory \"/home/janpf/Projects/gopjrt\".\n",
      "\t- Added replace rule for module \"github.com/gomlx/gemma\" to local directory \"/home/janpf/Projects/gemma\".\n",
      "\t- Added replace rule for module \"github.com/gomlx/gomlx\" to local directory \"/home/janpf/Projects/gomlx\".\n",
      "\t- Added replace rule for module \"github.com/janpfeifer/gonb\" to local directory \"/home/janpf/Projects/gonb\".\n"
     ]
    }
   ],
   "source": [
    "!*rm -f go.work && go work init && go work use . \"${HOME}/Projects/gemma\" \"${HOME}/Projects/gomlx\" \"${HOME}/Projects/gopjrt\" \"${HOME}/Projects/gonb\" \n",
    "%goworkfix"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bab750c9-1b9b-4c8a-b116-a15622d62663",
   "metadata": {},
   "source": [
    "## Learning Rational Function parameters\n",
    "\n",
    "This can be used to create initialization values for the rational functions, to mimic any given function.\n",
    "\n",
    "Buf first let's add the imports and some plotting functions:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fa06fa75-9bef-45b9-8006-7b43fa57adac",
   "metadata": {},
   "outputs": [],
   "source": [
    "//#@title Imports\n",
    "import (\n",
    "    \"github.com/gomlx/gomlx/backends\"\n",
    "    . \"github.com/gomlx/gomlx/pkg/core/graph\"\n",
    "    \"github.com/gomlx/gomlx/pkg/core/tensors\"\n",
    "    \"github.com/gomlx/gomlx/pkg/ml/context\"\n",
    "    \"github.com/gomlx/gomlx/pkg/ml/datasets\"\n",
    "    \"github.com/gomlx/gomlx/pkg/ml/layers/activations\"\n",
    "    \"github.com/gomlx/gomlx/pkg/ml/layers/rational\"\n",
    "    \"github.com/gomlx/gomlx/pkg/ml/train\"\n",
    "    \"github.com/janpfeifer/must\"\n",
    "\n",
    "    _ \"github.com/gomlx/gomlx/backends/default\"\n",
    "\n",
    "    // Plotting\n",
    "\tgonbplotly \"github.com/janpfeifer/gonb/gonbui/plotly\"\n",
    "    \n",
    "    grob \"github.com/MetalBlueberry/go-plotly/generated/v2.34.0/graph_objects\"\n",
    "    ptypes \"github.com/MetalBlueberry/go-plotly/pkg/types\"\n",
    ")\n",
    "\n",
    "var (\n",
    "    _ = Add\n",
    "    Backend = backends.MustNew()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b0f147d9-36db-4ce4-b2a7-4d178b368d1c",
   "metadata": {
    "jupyter": {
     "source_hidden": true
    }
   },
   "outputs": [],
   "source": [
    "// PlotXY\n",
    "func PlotXY(title string, xs, ys []float64) *grob.Fig {\n",
    "    fig := &grob.Fig{\n",
    "        Layout: &grob.Layout{\n",
    "            Title: &grob.LayoutTitle{\n",
    "                Text: ptypes.S(title),\n",
    "            },\n",
    "            Xaxis: &grob.LayoutXaxis{\n",
    "                Showgrid: ptypes.True,\n",
    "            },\n",
    "            Yaxis: &grob.LayoutYaxis{\n",
    "                Showgrid: ptypes.True,\n",
    "            },\n",
    "        },\n",
    "        Data: []ptypes.Trace{\n",
    "            &grob.Scatter{\n",
    "    \t\t\t// Type: grob.TraceTypeScatter,\n",
    "    \t\t\tLine: &grob.ScatterLine{\n",
    "    \t\t\t\tShape: grob.ScatterLineShapeLinear,\n",
    "    \t\t\t},\n",
    "    \t\t\tMode: \"lines+markers\",\n",
    "    \t\t\tX:    ptypes.DataArray(xs),\n",
    "    \t\t\tY:    ptypes.DataArray(ys),\n",
    "    \t\t},\n",
    "        },\n",
    "    }\n",
    "    return fig\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "9f1e11c1-0b7c-4a9d-9de9-5d06a4863f0d",
   "metadata": {
    "jupyter": {
     "source_hidden": true
    }
   },
   "outputs": [],
   "source": [
    "// PlotFuncs\n",
    "\n",
    "var PlotNumPoints = 1001\n",
    "\n",
    "// PlotFn takes as input a context for variables (can be ignored) and a vector of xs, and it should return the name of the function and the corresponding ys.\n",
    "type PlotFn func(ctx *context.Context, xs *Node) (name string, ys *Node)\n",
    "\n",
    "// PlotFuncs takes the title of the graph, the range of X (minX and maxX) and the functions to plot and returns a figure.\n",
    "func PlotFuncs(title string, minX, maxX float64, ctx *context.Context, fns ...PlotFn) *grob.Fig {\n",
    "    var fnNames []string\n",
    "    allValues := context.MustNewExec(Backend, ctx, func (ctx *context.Context, g *Graph) []*Node {\n",
    "        xs := Iota(g, shapes.Make(dtypes.Float64, PlotNumPoints), 0)\n",
    "        xs = MulScalar(xs, (maxX-minX)/float64(PlotNumPoints-1))\n",
    "        xs = AddScalar(xs, minX)\n",
    "\n",
    "        outputs := make([]*Node, 0, len(fns)+1)\n",
    "        outputs = append(outputs, xs)\n",
    "        fnNames = make([]string, 0, len(fns))\n",
    "        for _, fn := range fns {\n",
    "            name, ys := fn(ctx, xs)\n",
    "            fnNames = append(fnNames, name)\n",
    "            outputs = append(outputs, ys)\n",
    "        }\n",
    "        return outputs\n",
    "    }).MustExec()\n",
    "    xs := tensors.CopyFlatData[float64](allValues[0])\n",
    "    allYs := xslices.Map(allValues[1:], func(t *tensors.Tensor) []float64 {\n",
    "        return tensors.CopyFlatData[float64](t)\n",
    "    })\n",
    "    fig := &grob.Fig{\n",
    "        Layout: &grob.Layout{\n",
    "            Title: &grob.LayoutTitle{\n",
    "                Text: ptypes.S(title),\n",
    "            },\n",
    "            Xaxis: &grob.LayoutXaxis{\n",
    "                Showgrid: ptypes.True,\n",
    "            },\n",
    "            Yaxis: &grob.LayoutYaxis{\n",
    "                Showgrid: ptypes.True,\n",
    "            },\n",
    "            // Legend: &grob.LayoutLegend{\n",
    "                //Y:       -0.2,\n",
    "                //X:       1.0,\n",
    "                //X anchor: grob.LayoutLegendX anchorRight,\n",
    "                //Y anchor: grob.LayoutLegendY anchorTop,\n",
    "            // },\n",
    "        },\n",
    "        Data: make([]ptypes.Trace, len(fns)),\n",
    "    }\n",
    "    for fnIdx := range len(fns) {\n",
    "        fig.Data[fnIdx] = &grob.Scatter{\n",
    "            Name: ptypes.S(fnNames[fnIdx]),\n",
    "            // Type: grob.TraceTypeScatter,\n",
    "            Line: &grob.ScatterLine{\n",
    "                Shape: grob.ScatterLineShapeLinear,\n",
    "            },\n",
    "            Mode: \"lines\",\n",
    "            X:    ptypes.DataArray(xs),\n",
    "            Y:    ptypes.DataArray(allYs[fnIdx]),\n",
    "        }\n",
    "    }\n",
    "    return fig\n",
    "}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "724031d7-0779-4f0c-994f-8986a3f5b819",
   "metadata": {
    "jupyter": {
     "source_hidden": true
    }
   },
   "outputs": [],
   "source": [
    "// Example functions and plotting\n",
    "\n",
    "func swish(ctx *context.Context, x *Node) (string, *Node) {\n",
    "    return \"Swish(x)\", activations.Swish(x)\n",
    "}\n",
    "\n",
    "func gelu(ctx *context.Context, x *Node) (string, *Node) {\n",
    "    return \"Gelu(x)\", activations.Gelu(x)\n",
    "}\n",
    "\n",
    "%%\n",
    "// fig :=PlotFuncs(\"test\", -5.0, 5.0, context.New(), swish, gelu, target)\n",
    "// gonbplotly.DisplayFig(fig)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7872586f-d37c-4e46-99bb-c6f5f9f8c97d",
   "metadata": {},
   "source": [
    "### Estimate of the Variance Gain\n",
    "\n",
    "The KAT paper [1] argues that by estimating the \"gain\" defined as $\\alpha = \\mathbb{E}[\\frac{Var(x)}{F(x)^2}]$, and since we assume $x \\sim \\mathcal{N}(0, 1)$, we can make $Var[d_{in}wF(x)] = 1$, and it does so empirically.\n",
    "\n",
    "The function `estimateVarianceGain` calculates that $\\alpha$ that is also included in the cache entry, so one can initialize the GR-KAN layers in a variance preserving way."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "63de0846-d251-4e52-a83f-bce3bed9dcd1",
   "metadata": {
    "jupyter": {
     "source_hidden": true
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Identity(x) inverse of gain: 1.0001459406385227\n",
      "Swish(x) inverse of gain: 2.81095940825933\n",
      "Relu(x) inverse of gain: 2.001818138065777\n"
     ]
    }
   ],
   "source": [
    "// estimateVarianceGain used to adjust the W parameter for different curves:\n",
    "func estimateVarianceGain(ctx *context.Context, fn PlotFn, numPoints int) float64 {\n",
    "    return tensors.ToScalar[float64](\n",
    "        context.MustExecOnce(Backend, ctx, func (ctx *context.Context, g *Graph) *Node {\n",
    "            // input has a variance of 1\n",
    "            // rng := RngStateFromSeed(42)\n",
    "            // input := RandomNormal(g, shapes.Make(dtypes.Float64, numPoints))\n",
    "            input := ctx.RandomNormal(g, shapes.Make(dtypes.Float64, numPoints))\n",
    "            _, values := fn(ctx, input)\n",
    "            return Inverse(ReduceAllMean(Square(values)))\n",
    "        }))\n",
    "}\n",
    "\n",
    "func swish(ctx *context.Context, x *Node) (string, *Node) {\n",
    "    return \"Swish(x)\", activations.Swish(x)\n",
    "}\n",
    "\n",
    "func relu(ctx *context.Context, x *Node) (string, *Node) {\n",
    "    return \"Relu(x)\", activations.Relu(x)\n",
    "}\n",
    "\n",
    "func identity(ctx *context.Context, x *Node) (string, *Node) {\n",
    "    return \"Identity(x)\", x\n",
    "}\n",
    "\n",
    "%%\n",
    "numP := 10_000_000\n",
    "fmt.Printf(\"Identity(x) inverse of gain: %g\\n\", estimateVarianceGain(context.New(), identity, numP))\n",
    "fmt.Printf(\"Swish(x) inverse of gain: %g\\n\", estimateVarianceGain(context.New(), swish, numP))\n",
    "fmt.Printf(\"Relu(x) inverse of gain: %g\\n\", estimateVarianceGain(context.New(), relu, numP))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "acba2611-0872-4917-be0e-74c2a15fa9b8",
   "metadata": {},
   "source": [
    "### Estimate Initial Values Using Gradient Descent\n",
    "\n",
    "Now let's create a gradient descent optimizer for an arbitrary univariate function.\n",
    "\n",
    "The cell below defines `GenerateRationalCacheLine(target PlotFn, numeratorDegrees, denominatorDegrees int, rationalVersion string)` that conveniently outputs\n",
    "a cache line that can be copy&pasted to the file `cache.go` and used from there."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a92cf19c-4661-4cad-b9c0-1e4845df6f7a",
   "metadata": {},
   "outputs": [],
   "source": [
    "// GenerateRationalCacheLine\n",
    "var (\n",
    "    BatchSize = 10_000\n",
    "    NumSteps = 50_000\n",
    ")\n",
    "\n",
    "func loopTrain(ctx *context.Context, targetFn, trainableFn PlotFn, numSteps int) error {\n",
    "    ds := datasets.NewConstantDataset()\n",
    "    var targetName, trainableName string\n",
    "    // lossFn takes the predictions and the labels from the target, and return the mean-squared-loss.\n",
    "    lossFn := func(labels, logits []*Node) *Node {\n",
    "        predicted, label := logits[0], logits[1]\n",
    "        return Sqrt(ReduceAllMean(Square(Sub(predicted, label))))\n",
    "    }\n",
    "    modelFn := func(ctx *context.Context, spec any, inputs []*Node) []*Node {\n",
    "        g := inputs[0].Graph()\n",
    "        input := ctx.RandomNormal(g, shapes.Make(dtypes.Float64, BatchSize))\n",
    "        minX, maxX := -10.0,10.0\n",
    "        xs := Iota(g, shapes.Make(dtypes.Float64, BatchSize), 0)\n",
    "        xs = MulScalar(xs, (maxX-minX)/float64(BatchSize-1))\n",
    "        xs = AddScalar(xs, minX)\n",
    "        input = Concatenate([]*Node{input, xs}, -1)\n",
    "\n",
    "        var target, predicted *Node\n",
    "        trainableName, predicted = trainableFn(ctx, input)\n",
    "        targetName, target = targetFn(ctx, input)        \n",
    "        return []*Node{predicted, target}\n",
    "    }\n",
    "    trainer := train.NewTrainer(Backend, ctx, modelFn, lossFn, optimizers.ByName(ctx, \"adam\"), nil, nil)\n",
    "    loop := train.NewLoop(trainer)\n",
    "\tcommandline.AttachProgressBar(loop) // Attaches a progress bar to the loop.\n",
    "    metrics, err := loop.RunSteps(ds, numSteps)\n",
    "    if err != nil { \n",
    "        return err\n",
    "    }\n",
    "    fmt.Printf(\"%s/%s: loss=%v\\n\", targetName, trainableName, metrics[0])\n",
    "    return nil\n",
    "}\n",
    "\n",
    "// GenerateRationalCacheLine takes the target function and approximates with a rational function with the given parameters\n",
    "// and outputs the cache line that can be added to the `cache.go` file.\n",
    "//\n",
    "// See rational.New for details on the parameters.\n",
    "func GenerateRationalCacheLine(approximateName string, targetFn PlotFn, numeratorDegrees, denominatorDegrees int, rationalVersion string) {\n",
    "    ctx := context.New()\n",
    "    learnableFn := func (ctx *context.Context, x *Node) (string, *Node) {\n",
    "        ctx = ctx.In(\"rational\")\n",
    "        output := rational.New(ctx, x).\n",
    "            WithDegrees(numeratorDegrees, denominatorDegrees).\n",
    "            WithInputGroups(1).\n",
    "            Version(rationalVersion).\n",
    "            Approximate(\"identity\").\n",
    "            Done()\n",
    "        return \"Rational(x)\", output\n",
    "    }\n",
    "    ctx.SetParam(optimizers.LearningRateKey, 1.0e-4)\n",
    "    err := loopTrain(ctx, targetFn, learnableFn, NumSteps)\n",
    "    if err != nil {\n",
    "        fmt.Fprintf(os.Stderr, \"%+v\\n\", err)\n",
    "        os.Exit(1)\n",
    "    }\n",
    "    ctx = ctx.Reuse()  // After function is trained, we want to reuse the learned values.\n",
    "    gonbplotly.DisplayFig(PlotFuncs(\"Target vs Learned\", -5, 5, ctx, targetFn, learnableFn))\n",
    "\n",
    "    gain := estimateVarianceGain(ctx, learnableFn, 10_000_000)\n",
    "    numT := ctx.InspectVariable(\"/rational\", \"numeratorCoeffs\").Value()\n",
    "    denT := ctx.InspectVariable(\"/rational\", \"denominatorCoeffs\").Value()\n",
    "\n",
    "    fmt.Println(\"Cache entry line:\\n\")\n",
    "    fmt.Printf(\"\\t\\tinitCacheKey{Approximation: %q, Version: %q, NumeratorDegree: %d, DenominatorDegree: %d}: &initCacheValue{\\n\"+\n",
    "               \"\\t\\t\\tNum: %#v,\\n\\t\\t\\tDen: %#v,\\n\\t\\t\\tGainEstimate: %g},\\n\",\n",
    "               approximateName, rationalVersion, numeratorDegrees, denominatorDegrees,\n",
    "               tensors.CopyFlatData[float64](numT), tensors.CopyFlatData[float64](denT),\n",
    "               gain)\n",
    "}\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0a521bce-99c1-4e23-8f87-f0e06d1aa999",
   "metadata": {},
   "source": [
    "**Example 1**: Learning the $Swish(x)$ activation curve, using 6/5 degrees rational function, version \"B\":"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "b7343eda-9be4-4f34-9203-fe91f2fcc313",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "      \u001b[1m 100% [========================================] (5292 steps/s)\u001b[0m [step=99999] [loss+=0.012] [~loss+=0.0119] [~loss=0.0119]        ]         \n",
      "Swish(x)/Rational(x): loss=float64(0.012)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div id=\"c011168b\"></div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<script charset=\"UTF-8\">\n",
       "(() => {\n",
       "\tconst src=\"https://cdn.plot.ly/plotly-2.34.0.min.js\";\n",
       "\tvar runJSFn = function(module) {\n",
       "\t\t\n",
       "\tif (!module) {\n",
       "\t\tmodule = window.Plotly;\n",
       "\t}\n",
       "\tlet data = JSON.parse('{\"data\":[{\"type\":\"scatter\",\"line\":{\"shape\":\"linear\"},\"mode\":\"lines\",\"name\":\"Swish(x)\",\"x\":[-5,-4.99,-4.98,-4.97,-4.96,-4.95,-4.94,-4.93,-4.92,-4.91,-4.9,-4.89,-4.88,-4.87,-4.86,-4.85,-4.84,-4.83,-4.82,-4.81,-4.8,-4.79,-4.78,-4.77,-4.76,-4.75,-4.74,-4.73,-4.72,-4.71,-4.7,-4.69,-4.68,-4.67,-4.66,-4.65,-4.64,-4.63,-4.62,-4.61,-4.6,-4.59,-4.58,-4.57,-4.56,-4.55,-4.54,-4.53,-4.52,-4.51,-4.5,-4.49,-4.48,-4.47,-4.46,-4.45,-4.4399999999999995,-4.43,-4.42,-4.41,-4.4,-4.39,-4.38,-4.37,-4.36,-4.35,-4.34,-4.33,-4.32,-4.31,-4.3,-4.29,-4.28,-4.27,-4.26,-4.25,-4.24,-4.23,-4.22,-4.21,-4.2,-4.1899999999999995,-4.18,-4.17,-4.16,-4.15,-4.14,-4.13,-4.12,-4.11,-4.1,-4.09,-4.08,-4.07,-4.06,-4.05,-4.04,-4.03,-4.02,-4.01,-4,-3.99,-3.98,-3.9699999999999998,-3.96,-3.95,-3.94,-3.9299999999999997,-3.92,-3.91,-3.9,-3.8899999999999997,-3.88,-3.87,-3.86,-3.8499999999999996,-3.84,-3.83,-3.8200000000000003,-3.81,-3.8,-3.79,-3.7800000000000002,-3.77,-3.76,-3.75,-3.74,-3.73,-3.7199999999999998,-3.71,-3.7,-3.69,-3.6799999999999997,-3.67,-3.66,-3.65,-3.6399999999999997,-3.63,-3.62,-3.61,-3.5999999999999996,-3.59,-3.58,-3.5700000000000003,-3.56,-3.55,-3.54,-3.5300000000000002,-3.52,-3.51,-3.5,-3.49,-3.48,-3.4699999999999998,-3.46,-3.45,-3.44,-3.4299999999999997,-3.42,-3.41,-3.4,-3.3899999999999997,-3.38,-3.37,-3.36,-3.3499999999999996,-3.34,-3.33,-3.3200000000000003,-3.31,-3.3,-3.29,-3.2800000000000002,-3.27,-3.26,-3.25,-3.24,-3.23,-3.2199999999999998,-3.21,-3.2,-3.19,-3.1799999999999997,-3.17,-3.16,-3.15,-3.1399999999999997,-3.13,-3.12,-3.11,-3.0999999999999996,-3.09,-3.08,-3.0700000000000003,-3.06,-3.05,-3.04,-3.0300000000000002,-3.02,-3.01,-3,-2.9899999999999998,-2.98,-2.9699999999999998,-2.96,-2.95,-2.94,-2.93,-2.92,-2.91,-2.9,-2.89,-2.88,-2.87,-2.86,-2.85,-2.84,-2.83,-2.82,-2.81,-2.8,-2.79,-2.78,-2.77,-2.76,-2.75,-2.7399999999999998,-2.73,-2.7199999999999998,-2.71,-2.6999999999999997,-2.69,-2.68,-2.67,-2.66,-2.65,-2.64,-2.63,-2.62,-2.61,-2.6,-2.59,-2.58,-2.57,-2.56,-2.55,-2.54,-2.53,-2.52,-2.51,-2.5,-2.4899999999999998,-2.48,-2.4699999999999998,-2.46,-2.4499999999999997,-2.44,-2.43,-2.42,-2.41,-2.4,-2.39,-2.38,-2.37,-2.36,-2.35,-2.34,-2.33,-2.32,-2.31,-2.3,-2.29,-2.28,-2.27,-2.26,-2.25,-2.2399999999999998,-2.23,-2.2199999999999998,-2.21,-2.1999999999999997,-2.19,-2.18,-2.17,-2.16,-2.15,-2.14,-2.13,-2.12,-2.11,-2.1,-2.09,-2.08,-2.07,-2.06,-2.05,-2.04,-2.03,-2.02,-2.01,-2,-1.9899999999999998,-1.98,-1.9699999999999998,-1.96,-1.9499999999999997,-1.94,-1.9299999999999997,-1.92,-1.9100000000000001,-1.9,-1.8900000000000001,-1.88,-1.87,-1.8599999999999999,-1.85,-1.8399999999999999,-1.83,-1.8199999999999998,-1.81,-1.7999999999999998,-1.79,-1.7799999999999998,-1.77,-1.7599999999999998,-1.75,-1.7399999999999998,-1.73,-1.7199999999999998,-1.71,-1.6999999999999997,-1.69,-1.6799999999999997,-1.67,-1.6600000000000001,-1.65,-1.6400000000000001,-1.63,-1.62,-1.6099999999999999,-1.6,-1.5899999999999999,-1.58,-1.5699999999999998,-1.56,-1.5499999999999998,-1.54,-1.5299999999999998,-1.52,-1.5099999999999998,-1.5,-1.4899999999999998,-1.48,-1.4699999999999998,-1.46,-1.4499999999999997,-1.44,-1.4299999999999997,-1.42,-1.4100000000000001,-1.4,-1.3900000000000001,-1.38,-1.37,-1.3599999999999999,-1.35,-1.3399999999999999,-1.33,-1.3199999999999998,-1.31,-1.2999999999999998,-1.29,-1.2799999999999998,-1.27,-1.2599999999999998,-1.25,-1.2399999999999998,-1.23,-1.2199999999999998,-1.21,-1.1999999999999997,-1.19,-1.1799999999999997,-1.17,-1.1600000000000001,-1.15,-1.1400000000000001,-1.13,-1.12,-1.1099999999999999,-1.1,-1.0899999999999999,-1.08,-1.0699999999999998,-1.06,-1.0499999999999998,-1.04,-1.0299999999999998,-1.02,-1.0099999999999998,-1,-0.9900000000000002,-0.9799999999999995,-0.9699999999999998,-0.96,-0.9500000000000002,-0.9399999999999995,-0.9299999999999997,-0.9199999999999999,-0.9100000000000001,-0.9000000000000004,-0.8899999999999997,-0.8799999999999999,-0.8700000000000001,-0.8600000000000003,-0.8499999999999996,-0.8399999999999999,-0.8300000000000001,-0.8200000000000003,-0.8099999999999996,-0.7999999999999998,-0.79,-0.7800000000000002,-0.7699999999999996,-0.7599999999999998,-0.75,-0.7400000000000002,-0.7299999999999995,-0.7199999999999998,-0.71,-0.7000000000000002,-0.6899999999999995,-0.6799999999999997,-0.6699999999999999,-0.6600000000000001,-0.6499999999999995,-0.6399999999999997,-0.6299999999999999,-0.6200000000000001,-0.6100000000000003,-0.5999999999999996,-0.5899999999999999,-0.5800000000000001,-0.5700000000000003,-0.5599999999999996,-0.5499999999999998,-0.54,-0.5300000000000002,-0.5199999999999996,-0.5099999999999998,-0.5,-0.4900000000000002,-0.47999999999999954,-0.46999999999999975,-0.45999999999999996,-0.4500000000000002,-0.4399999999999995,-0.4299999999999997,-0.41999999999999993,-0.41000000000000014,-0.39999999999999947,-0.3899999999999997,-0.3799999999999999,-0.3700000000000001,-0.3600000000000003,-0.34999999999999964,-0.33999999999999986,-0.33000000000000007,-0.3200000000000003,-0.3099999999999996,-0.2999999999999998,-0.29000000000000004,-0.28000000000000025,-0.2699999999999996,-0.2599999999999998,-0.25,-0.2400000000000002,-0.22999999999999954,-0.21999999999999975,-0.20999999999999996,-0.20000000000000018,-0.1899999999999995,-0.17999999999999972,-0.16999999999999993,-0.16000000000000014,-0.14999999999999947,-0.13999999999999968,-0.1299999999999999,-0.1200000000000001,-0.11000000000000032,-0.09999999999999964,-0.08999999999999986,-0.08000000000000007,-0.07000000000000028,-0.05999999999999961,-0.04999999999999982,-0.040000000000000036,-0.03000000000000025,-0.019999999999999574,-0.009999999999999787,0,0.009999999999999787,0.020000000000000462,0.03000000000000025,0.040000000000000036,0.04999999999999982,0.0600000000000005,0.07000000000000028,0.08000000000000007,0.08999999999999986,0.10000000000000053,0.11000000000000032,0.1200000000000001,0.1299999999999999,0.13999999999999968,0.15000000000000036,0.16000000000000014,0.16999999999999993,0.17999999999999972,0.1900000000000004,0.20000000000000018,0.20999999999999996,0.21999999999999975,0.23000000000000043,0.2400000000000002,0.25,0.2599999999999998,0.27000000000000046,0.28000000000000025,0.29000000000000004,0.2999999999999998,0.3100000000000005,0.3200000000000003,0.33000000000000007,0.33999999999999986,0.35000000000000053,0.3600000000000003,0.3700000000000001,0.3799999999999999,0.3899999999999997,0.40000000000000036,0.41000000000000014,0.41999999999999993,0.4299999999999997,0.4400000000000004,0.4500000000000002,0.45999999999999996,0.46999999999999975,0.4800000000000004,0.4900000000000002,0.5,0.5099999999999998,0.5200000000000005,0.5300000000000002,0.54,0.5499999999999998,0.5600000000000005,0.5700000000000003,0.5800000000000001,0.5899999999999999,0.6000000000000005,0.6100000000000003,0.6200000000000001,0.6299999999999999,0.6399999999999997,0.6500000000000004,0.6600000000000001,0.6699999999999999,0.6799999999999997,0.6900000000000004,0.7000000000000002,0.71,0.7199999999999998,0.7300000000000004,0.7400000000000002,0.75,0.7599999999999998,0.7700000000000005,0.7800000000000002,0.79,0.7999999999999998,0.8100000000000005,0.8200000000000003,0.8300000000000001,0.8399999999999999,0.8500000000000005,0.8600000000000003,0.8700000000000001,0.8799999999999999,0.8899999999999997,0.9000000000000004,0.9100000000000001,0.9199999999999999,0.9299999999999997,0.9400000000000004,0.9500000000000002,0.96,0.9699999999999998,0.9800000000000004,0.9900000000000002,1,1.0099999999999998,1.0200000000000005,1.0300000000000002,1.04,1.0499999999999998,1.0600000000000005,1.0700000000000003,1.08,1.0899999999999999,1.1000000000000005,1.1100000000000003,1.12,1.13,1.1400000000000006,1.1500000000000004,1.1600000000000001,1.17,1.1799999999999997,1.1900000000000004,1.2000000000000002,1.21,1.2199999999999998,1.2300000000000004,1.2400000000000002,1.25,1.2599999999999998,1.2700000000000005,1.2800000000000002,1.29,1.2999999999999998,1.3100000000000005,1.3200000000000003,1.33,1.3399999999999999,1.3500000000000005,1.3600000000000003,1.37,1.38,1.3900000000000006,1.4000000000000004,1.4100000000000001,1.42,1.4299999999999997,1.4400000000000004,1.4500000000000002,1.46,1.4699999999999998,1.4800000000000004,1.4900000000000002,1.5,1.5099999999999998,1.5200000000000005,1.5300000000000002,1.54,1.5499999999999998,1.5600000000000005,1.5700000000000003,1.58,1.5899999999999999,1.6000000000000005,1.6100000000000003,1.62,1.63,1.6400000000000006,1.6500000000000004,1.6600000000000001,1.67,1.6799999999999997,1.6900000000000004,1.7000000000000002,1.71,1.7199999999999998,1.7300000000000004,1.7400000000000002,1.75,1.7599999999999998,1.7700000000000005,1.7800000000000002,1.79,1.7999999999999998,1.8100000000000005,1.8200000000000003,1.83,1.8399999999999999,1.8500000000000005,1.8600000000000003,1.87,1.88,1.8900000000000006,1.9000000000000004,1.9100000000000001,1.92,1.9299999999999997,1.9400000000000004,1.9500000000000002,1.96,1.9699999999999998,1.9800000000000004,1.9900000000000002,2,2.01,2.0200000000000005,2.0300000000000002,2.04,2.05,2.0600000000000005,2.0700000000000003,2.08,2.09,2.1000000000000005,2.1100000000000003,2.12,2.13,2.1400000000000006,2.1500000000000004,2.16,2.17,2.1799999999999997,2.1900000000000004,2.2,2.21,2.2199999999999998,2.2300000000000004,2.24,2.25,2.26,2.2700000000000005,2.2800000000000002,2.29,2.3,2.3100000000000005,2.3200000000000003,2.33,2.34,2.3500000000000005,2.3600000000000003,2.37,2.38,2.3900000000000006,2.4000000000000004,2.41,2.42,2.4299999999999997,2.4400000000000004,2.45,2.46,2.4699999999999998,2.4800000000000004,2.49,2.5,2.51,2.5200000000000005,2.5300000000000002,2.54,2.55,2.5600000000000005,2.5700000000000003,2.58,2.59,2.6000000000000005,2.6100000000000003,2.62,2.63,2.6400000000000006,2.6500000000000004,2.66,2.67,2.6799999999999997,2.6900000000000004,2.7,2.71,2.7199999999999998,2.7300000000000004,2.74,2.75,2.76,2.7700000000000005,2.7800000000000002,2.79,2.8,2.8100000000000005,2.8200000000000003,2.83,2.84,2.8500000000000005,2.8600000000000003,2.87,2.88,2.8900000000000006,2.9000000000000004,2.91,2.92,2.9300000000000006,2.9400000000000004,2.95,2.96,2.9699999999999998,2.9800000000000004,2.99,3,3.01,3.0199999999999996,3.0299999999999994,3.040000000000001,3.0500000000000007,3.0600000000000005,3.0700000000000003,3.08,3.09,3.0999999999999996,3.1099999999999994,3.120000000000001,3.130000000000001,3.1400000000000006,3.1500000000000004,3.16,3.17,3.1799999999999997,3.1899999999999995,3.1999999999999993,3.210000000000001,3.2200000000000006,3.2300000000000004,3.24,3.25,3.26,3.2699999999999996,3.2799999999999994,3.290000000000001,3.3000000000000007,3.3100000000000005,3.3200000000000003,3.33,3.34,3.3499999999999996,3.3599999999999994,3.370000000000001,3.380000000000001,3.3900000000000006,3.4000000000000004,3.41,3.42,3.4299999999999997,3.4399999999999995,3.4499999999999993,3.460000000000001,3.4700000000000006,3.4800000000000004,3.49,3.5,3.51,3.5199999999999996,3.5299999999999994,3.540000000000001,3.5500000000000007,3.5600000000000005,3.5700000000000003,3.58,3.59,3.5999999999999996,3.6099999999999994,3.620000000000001,3.630000000000001,3.6400000000000006,3.6500000000000004,3.66,3.67,3.6799999999999997,3.6899999999999995,3.700000000000001,3.710000000000001,3.7200000000000006,3.7300000000000004,3.74,3.75,3.76,3.7699999999999996,3.7799999999999994,3.790000000000001,3.8000000000000007,3.8100000000000005,3.8200000000000003,3.83,3.84,3.8499999999999996,3.8599999999999994,3.870000000000001,3.880000000000001,3.8900000000000006,3.9000000000000004,3.91,3.92,3.9299999999999997,3.9399999999999995,3.950000000000001,3.960000000000001,3.9700000000000006,3.9800000000000004,3.99,4,4.01,4.02,4.029999999999999,4.040000000000001,4.050000000000001,4.0600000000000005,4.07,4.08,4.09,4.1,4.109999999999999,4.120000000000001,4.130000000000001,4.140000000000001,4.15,4.16,4.17,4.18,4.1899999999999995,4.200000000000001,4.210000000000001,4.220000000000001,4.23,4.24,4.25,4.26,4.27,4.279999999999999,4.290000000000001,4.300000000000001,4.3100000000000005,4.32,4.33,4.34,4.35,4.359999999999999,4.370000000000001,4.380000000000001,4.390000000000001,4.4,4.41,4.42,4.43,4.4399999999999995,4.450000000000001,4.460000000000001,4.470000000000001,4.48,4.49,4.5,4.51,4.52,4.529999999999999,4.540000000000001,4.550000000000001,4.5600000000000005,4.57,4.58,4.59,4.6,4.609999999999999,4.620000000000001,4.630000000000001,4.640000000000001,4.65,4.66,4.67,4.68,4.6899999999999995,4.700000000000001,4.710000000000001,4.720000000000001,4.73,4.74,4.75,4.76,4.77,4.779999999999999,4.790000000000001,4.800000000000001,4.8100000000000005,4.82,4.83,4.84,4.85,4.859999999999999,4.870000000000001,4.880000000000001,4.890000000000001,4.9,4.91,4.92,4.93,4.9399999999999995,4.950000000000001,4.960000000000001,4.970000000000001,4.98,4.99,5],\"y\":[-0.03346425462142428,-0.033730705948459117,-0.03399911946224804,-0.03426950746925134,-0.03454188232169996,-0.03481625641722605,-0.03509264219848055,-0.035371052152738454,-0.03565149881149063,-0.03593399475002296,-0.03621855258698166,-0.0365051849839252,-0.03679390464486216,-0.03708472431577519,-0.03737765678413049,-0.03767271487837277,-0.03796991146740527,-0.03826925946005497,-0.03857077180452228,-0.03887446148781517,-0.0391803415351675,-0.03948842500944149,-0.03979872501051348,-0.0401112546746434,-0.040426027173827116,-0.040743055715131926,-0.04106235354001439,-0.0413839339236206,-0.041707810174068445,-0.04203399563171152,-0.04236250366838477,-0.04269334768663097,-0.04302654111890828,-0.04336209742677822,-0.04370003010007415,-0.04404035265604941,-0.04438307863850537,-0.04472822161689859,-0.045075795185427266,-0.045425812962096135,-0.04577828858775989,-0.04613323572514454,-0.04649066805784666,-0.04685059928930987,-0.047213043141778384,-0.047578013355227225,-0.04794552368626897,-0.04831558790703627,-0.04868821980404014,-0.0490634331770034,-0.049441241837669306,-0.04982165960858447,-0.05020470032185605,-0.0505903778178828,-0.05097870594405942,-0.051369698553454184,-0.05176336950345899,-0.05215973265441168,-0.05255880186819051,-0.05296059100677978,-0.053365113930806646,-0.053772384498048685,-0.05418241656191143,-0.05459522396987616,-0.055010820561916696,-0.05542922016888549,-0.05585043661086788,-0.05627448369550505,-0.05670137521628409,-0.05713112495079576,-0.057563746658958546,-0.05799925408120974,-0.058437660936661806,-0.05887898092122446,-0.059323227705691685,-0.05977041493379327,-0.06022055622021037,-0.06067366514855461,-0.061129755269310276,-0.06158884009773899,-0.06205093311174684,-0.06251604774971273,-0.06298419740827799,-0.06345539544009676,-0.06392965515154629,-0.06440698980039689,-0.06488741259344108,-0.06537093668408105,-0.06585757516987464,-0.0663473410900384,-0.06684024742290787,-0.06733630708335421,-0.06783553292015702,-0.06833793771333224,-0.06884353417141516,-0.06935233492869733,-0.06986435254241792,-0.07037959948990755,-0.07089808816568519,-0.07141983087850685,-0.07194483984836623,-0.07247312720344573,-0.07300470497701829,-0.07353958510429867,-0.07407777941924422,-0.07461929965130425,-0.07516415742211716,-0.07571236424215531,-0.0762639315073167,-0.07681887049546281,-0.07737719236290229,-0.07793890814081941,-0.07850402873164736,-0.07907256490538517,-0.07964452729585793,-0.08021992639691966,-0.0807987725585982,-0.08138107598318164,-0.08196684672124543,-0.08255609466761962,-0.0831488295572958,-0.08374506096127302,-0.08434479828234183,-0.08494805075080636,-0.08555482742014303,-0.08616513716259605,-0.08677898866470884,-0.08739639042279028,-0.08801735073831571,-0.08864187771326204,-0.08926997924537602,-0.08990166302337527,-0.09053693652208115,-0.09117580699748355,-0.09181828148173612,-0.09246436677808181,-0.09311406945570799,-0.09376739584453053,-0.09442435202990623,-0.09508494384727302,-0.0957491768767171,-0.09641705643746665,-0.09708858758231168,-0.09776377509194867,-0.09844262346925037,-0.09912513693345923,-0.0998113194143047,-0.10050117454604326,-0.10119470566142069,-0.1018919157855561,-0.10259280762974712,-0.10329738358519575,-0.1040056457166541,-0.10471759575598952,-0.1054332350956688,-0.10615256478216063,-0.1068755855092559,-0.10760229761130512,-0.10833270105637288,-0.10906679543930839,-0.10980457997473175,-0.1105460534899354,-0.11129121441770054,-0.11204006078902773,-0.11279259022578127,-0.11354879993324683,-0.11430868669260225,-0.11507224685330078,-0.11583947632536627,-0.11661037057160013,-0.11738492459969939,-0.11816313295428602,-0.11894498970884655,-0.11973048845758193,-0.12051962230716716,-0.12131238386842073,-0.12210876524788318,-0.1229087580393045,-0.12371235331504055,-0.12451954161735769,-0.12533031294964594,-0.12614465676753994,-0.12696256196994787,-0.12778401688998825,-0.1286090092858341,-0.1294375263314648,-0.130269554607325,-0.1311050800908912,-0.13194408814714545,-0.1327865635189563,-0.13363249031736701,-0.13448185201179105,-0.1353346314201153,-0.13619081069871006,-0.1370503713323474,-0.13791329412402684,-0.13877955918470894,-0.13964914592295732,-0.14052203303448904,-0.14139819849163346,-0.14227761953270035,-0.14316027265125744,-0.14404613358531754,-0.144935177306436,-0.1458273780087189,-0.14672270909774232,-0.1476211431793836,-0.14852265204856444,-0.14942720667790763,-0.1503347772063069,-0.15124533292741144,-0.1521588422780254,-0.15307527282642353,-0.1539945912605833,-0.15491676337633514,-0.15584175406543116,-0.1567695273035334,-0.15770004613812313,-0.15863327267633198,-0.15956916807269564,-0.1605076925168325,-0.1614488052210472,-0.1623924644078616,-0.16333862729747317,-0.1642872500951442,-0.16523828797852097,-0.16619169508488688,-0.16714742449834882,-0.16810542823696098,-0.16906565723978484,-0.17002806135389056,-0.17099258932129868,-0.17195918876586613,-0.17292780618011735,-0.1738983869120232,-0.17487087515172978,-0.17584521391823932,-0.1768213450460456,-0.1777992091717256,-0.17877874572049113,-0.17975989289270172,-0.18074258765034243,-0.18172676570346805,-0.18271236149661804,-0.18369930819520341,-0.1846875376718702,-0.18567698049284062,-0.18666756590423716,-0.18765922181839076,-0.1886518748001378,-0.18964545005310887,-0.1906398714060123,-0.19163506129891653,-0.19263094076953496,-0.19362742943951666,-0.19462444550074706,-0.19562190570166207,-0.1966197253335808,-0.1976178182170591,-0.19861609668826985,-0.1996144715854137,-0.20061285223516392,-0.20161114643915118,-0.20260926046049152,-0.2036070990103634,-0.20460456523463744,-0.20560156070056493,-0.20659798538352855,-0.20759373765386252,-0.20858871426374484,-0.20958281033416915,-0.21057591934199993,-0.21156793310711802,-0.21255874177966003,-0.21354823382736005,-0.21453629602299634,-0.215522813431952,-0.21650766939989258,-0.21749074554056977,-0.21847192172375435,-0.21945107606330735,-0.22042808490539403,-0.2214028228168479,-0.22237516257369128,-0.22334497514981907,-0.22431212970585282,-0.22527649357817092,-0.22623793226812394,-0.22719630943143973,-0.22815148686782752,-0.22910332451078716,-0.2300516804176313,-0.23099641075972774,-0.23193736981296995,-0.23287440994848269,-0.2338073816235713,-0.2347361333729216,-0.23566051180005954,-0.23658036156907666,-0.23749552539663177,-0.2384058440442351,-0.2393111563108241,-0.24021129902563898,-0.24110610704140628,-0.24199541322783902,-0.24287904846546204,-0.24375684163977063,-0.24462861963573176,-0.24549420733263613,-0.24635342759931014,-0.24720610128969592,-0.2480520472388091,-0.2488910822590829,-0.24972302113710734,-0.25054767663077226,-0.2513648594668244,-0.25217437833884576,-0.2529760399056641,-0.2537696487902032,-0.25455500757878285,-0.2553319168208781,-0.2561001750293447,-0.25685957868112336,-0.2576099222184285,-0.25835099805043304,-0.25908259655545657,-0.2598045060836681,-0.26051651296031003,-0.26121840148945397,-0.26190995395829736,-0.26259095064200905,-0.2632611698091331,-0.2639203877275606,-0.26456837867107624,-0.2652049149264906,-0.26582976680136566,-0.2664427026323416,-0.267043488794075,-0.2676318897087957,-0.2682076678564901,-0.26877058378572083,-0.26932039612508973,-0.26985686159535166,-0.27037973502218815,-0.27088876934964784,-0.2713837156542617,-0.2718643231598397,-0.2723303392529572,-0.27278150949913677,-0.2732175776597344,-0.2736382857095345,-0.2740433738550614,-0.2744325805536137,-0.27480564253302814,-0.27516229481217636,-0.27550227072220385,-0.27582530192851323,-0.27613111845349947,-0.27641944870004065,-0.27669001947574856,-0.2769425560179855,-0.2771767820196492,-0.2773924196557305,-0.27758918961064866,-0.2777668111063648,-0.2779250019312789,-0.27806347846991175,-0.27818195573337423,-0.2782801473906262,-0.2783577658005263,-0.2784145220446738,-0.2784501259610438,-0.278464286178416,-0.27845671015159706,-0.27842710419743666,-0.27837517353163604,-0.27830062230634894,-0.27820315364857184,-0.2780824696993239,-0.27793827165361173,-0.2777702598011788,-0.2775781335680341,-0.27736159155875767,-0.27712033159957916,-0.2768540507822239,-0.2765624455085223,-0.27624521153577647,-0.2759020440228793,-0.27553263757717816,-0.2751366863020771,-0.2747138838453706,-0.27426392344830003,-0.27378649799532484,-0.2732813000646007,-0.27274802197915304,-0.2721863558587383,-0.2715959936723811,-0.2709766272915771,-0.2703279485441509,-0.26964964926875384,-0.2689414213699951,-0.2682029568741866,-0.26743394798569303,-0.2666340871438716,-0.26580306708058576,-0.2649405808782801,-0.2640463220285991,-0.2631199844915355,-0.2621612627550894,-0.26116985189542374,-0.2601454476374965,-0.25908774641615323,-0.2579964454376605,-0.2568712427416608,-0.2557118372635309,-0.254517928897123,-0.2532892185578674,-0.2520254082462177,-0.250726201111415,-0.24939130151555153,-0.24802041509791004,-0.2466132488395561,-0.24516951112816204,-0.2436889118230369,-0.24217116232034058,-0.24061597561845527,-0.23902306638349302,-0.2373921510149111,-0.23572294771121244,-0.23401517653570328,-0.23226855948228375,-0.23048282054124392,-0.22865768576504014,-0.22679288333402187,-0.22488814362208562,-0.2229431992622257,-0.2209577852119556,-0.21893163881857094,-0.21686449988422726,-0.21475611073080342,-0.21260621626452267,-0.21041456404030293,-0.20818090432580613,-0.20590499016516015,-0.20358657744232278,-0.2012254249440596,-0.1988212944225051,-0.19637395065728075,-0.1938831615171382,-0.191348698021101,-0.1887703343990727,-0.18614784815188587,-0.18348102011076037,-0.1807696344961443,-0.17801347897590566,-0.17521234472285016,-0.1723660264715335,-0.16947432257434286,-0.16653703505681494,-0.16355396967216845,-0.16052493595501904,-0.15744974727425265,-0.15432822088502574,-0.1511601779798714,-0.14794544373888066,-0.14468384737893436,-0.14137522220196147,-0.1380194056421941,-0.13461623931240027,-0.1311655690490655,-0.12766724495650225,-0.12412112144985961,-0.12052705729701597,-0.11688491565932715,-0.11319456413121234,-0.10945587477855048,-0.10566872417587377,-0.10183299344233204,-0.09794856827641267,-0.0940153389893917,-0.09003320053750449,-0.08600205255281285,-0.08192179937275545,-0.07779235006836029,-0.07361361847110955,-0.06938552319843734,-0.06510798767784984,-0.06078094016964851,-0.056404313788251434,-0.051978046522094826,-0.04750208125210584,-0.04297636576873792,-0.038400852787553494,-0.03377549996335285,-0.02910026990283521,-0.024375130175789395,-0.0196000533248014,-0.014775016873481508,-0.009900003333199797,-0.004975000208331144,0,0.005024999791668643,0.010099996666800231,0.01522498312651874,0.02039994667519864,0.025624869824210427,0.03089973009716487,0.036224500036647435,0.041599147212446584,0.04702363423126193,0.05249791874789429,0.05802195347790549,0.06359568621174866,0.06921905983035137,0.07489201232214984,0.08061447680156265,0.08638638152889058,0.09220764993163963,0.09807820062724425,0.1039979474471872,0.10996679946249568,0.1159846610106083,0.12205143172358708,0.12816700655766802,0.1343312758241264,0.14054412522144952,0.14680543586878744,0.15311508434067297,0.1594729427029843,0.1658788785501404,0.17233275504349757,0.17883443095093468,0.1853837606876,0.19198059435780604,0.1986247777980384,0.2053161526210659,0.2120545562611197,0.2188398220201287,0.22567177911497419,0.23255025272574706,0.23947506404498106,0.2464460303278317,0.253462964943185,0.26052567742565685,0.26763397352846663,0.27478765527715004,0.2819865210240943,0.28923036550385545,0.2965189798892398,0.3038521518481143,0.3112296656009273,0.31865130197889874,0.32611683848286205,0.33362604934271944,0.3411787055774949,0.3487745750559403,0.3564134225576775,0.3640950098348401,0.37181909567419397,0.3795854359596969,0.3873937837354777,0.3952438892691969,0.40313550011577287,0.4110683611814289,0.41904221478804404,0.42705680073777447,0.4351118563779145,0.443207116665978,0.4513423142349595,0.4595171794587563,0.4677314405177164,0.4759848234642967,0.4842770522887873,0.4926078489850892,0.5009769336165072,0.5093840243815447,0.5178288376796593,0.5263110881769635,0.5348304888718383,0.543386751160444,0.5519795849020899,0.5606086984844488,0.5692737988885853,0.5779745917537824,0.5867107814421324,0.5954820711028775,0.6042881627364693,0.6131287572583393,0.6220035545623394,0.6309122535838464,0.6398545523625039,0.6488301481045764,0.6578387372449105,0.6668800155084642,0.6759536779714013,0.6850594191217201,0.6941969329194142,0.7033659128561282,0.7125660520143072,0.7217970431258137,0.7310585786300049,0.7403503507312459,0.7496720514558497,0.7590233727084231,0.7684040063276188,0.7778136441412614,0.7872519780208473,0.7967186999353996,0.8062135020046751,0.8157360765516999,0.8252861161546299,0.8348633136979231,0.844467362422822,0.8540979559771206,0.863754788464224,0.8734375544914782,0.8831459492177762,0.8928796684004208,0.9026384084412421,0.9124218664319662,0.9222297401988214,0.9320617283463882,0.9419175303006759,0.9517968463514285,0.9616993776936514,0.9716248264683638,0.9815728958025632,0.9915432898484036,1.0015357138215841,1.0115498740389564,1.021585477955326,1.0316422341994742,1.041719852609374,1.051818044266626,1.061936521530088,1.0720749980687216,1.0822331888936354,1.0924108103893515,1.1026075803442694,1.1128232179803514,1.123057443982015,1.1333099805242515,1.1435805512999593,1.1538688815465004,1.1641746980714873,1.1744977292777965,1.1848377051878236,1.1951943574669717,1.2055674194463866,1.2159566261449388,1.2263617142904655,1.2367824223402655,1.2472184905008639,1.257669660747043,1.2681356768401604,1.278616284345738,1.2891112306503525,1.2996202649778121,1.3101431384046485,1.3206796038749102,1.3312294162142797,1.3417923321435103,1.3523681102912044,1.3629565112059248,1.373557297367659,1.3841702331986345,1.3947950850735094,1.4054316213289237,1.416079612272439,1.4267388301908672,1.437409049357991,1.4480900460417028,1.4587815985105457,1.4694834870396905,1.4801954939163322,1.4909174034445436,1.501649001949567,1.512390077781572,1.523140421318877,1.5338998249706555,1.544668083179122,1.5554449924212177,1.5662303512097973,1.5770239600943359,1.5878256216611544,1.5986351405331762,1.6094523233692282,1.620276978862893,1.631108917740917,1.6419479527611918,1.6527938987103044,1.6636465724006897,1.6745057926673639,1.685371380364268,1.6962431583602298,1.7071209515345382,1.7180045867721607,1.7288938929585935,1.7397887009743616,1.7506888436891763,1.7615941559557646,1.772504474603368,1.7834196384309238,1.7943394881999408,1.8052638666270784,1.8161926183764285,1.827125590051518,1.8380626301870304,1.8490035892402723,1.8599483195823685,1.8708966754892133,1.881848513132173,1.8928036905685606,1.903762067731876,1.9147235064218298,1.9256878702941473,1.936655024850181,1.9476248374263088,1.9585971771831516,1.9695719150946063,1.9805489239366927,1.9915280782762457,2.00250925445943,2.013492330600108,2.024477186568048,2.035463703977004,2.04645176617264,2.0574412582203405,2.0684320668928824,2.079424080658,2.0904171896658306,2.1014112857362557,2.1124062623461377,2.1234020146164716,2.134398439299435,2.1453954347653634,2.156392900989637,2.167390739539509,2.1783888535608487,2.189387147764837,2.2003855284145866,2.21138390331173,2.222382181782941,2.233380274666419,2.2443780942983382,2.255375554499253,2.266372570560484,2.2773690592304647,2.288364938701084,2.299360128593988,2.3103545499468914,2.321348125199862,2.3323407781816097,2.343332434095763,2.3543230195071594,2.3653124623281294,2.3763006918047966,2.3872876385033823,2.398273234296532,2.4092574123496573,2.420240107107299,2.4312212542795093,2.4422007908282746,2.4531786549539545,2.464154786081761,2.4751291248482707,2.486101613087977,2.4970721938198825,2.5080408112341335,2.5190074106787015,2.5299719386461095,2.540934342760215,2.551894571763039,2.562852575501652,2.5738083049151133,2.584761712021479,2.5957127499048553,2.6066613727025274,2.6176075355921387,2.628551194778953,2.6394923074831675,2.650430831927305,2.6613667273236685,2.672299953861877,2.6832304726964664,2.694158245934569,2.7050832366236652,2.7160054087394165,2.7269247271735764,2.7378411577219754,2.748754667072589,2.7596652227936933,2.7705727933220925,2.781477347951436,2.792378856820617,2.8032772909022583,2.814172621991281,2.8250648226935637,2.835953866414683,2.8468397273487427,2.8577223804673,2.868601801508366,2.8794779669655104,2.890350854077042,2.901220440815292,2.9120867058759736,2.9229496286676535,2.9338091893012903,2.944665368579885,2.955518147988209,2.9663675096826325,2.9772134364810428,2.9880559118528556,2.9988949199091097,3.009730445392676,3.0205624736685355,3.0313909907141663,3.0422159831100113,3.0530374380300516,3.0638553432324596,3.0746696870503536,3.085480458382643,3.09628764668496,3.107091241960696,3.117891234752117,3.1286876161315798,3.1394803776928324,3.1502695115424175,3.161055010291153,3.171836867045715,3.1826150754003013,3.1933896294284008,3.2041605236746338,3.2149277531466995,3.2256913133073972,3.2364512000667527,3.2472074097742185,3.257959939210973,3.2687087855823003,3.279453946510065,3.290195420025269,3.300933204560692,3.311667298943627,3.3223977023886944,3.3331244144907433,3.3438474352178384,3.3545667649043325,3.3652824042440113,3.3759943542833466,3.3867026164148046,3.397407192370253,3.408108084214444,3.4188052943385787,3.4294988254539556,3.4401886805856963,3.450874863066542,3.4615573765307506,3.4722362249080514,3.482911412417688,3.4935829435625334,3.5042508231232823,3.5149150561527263,3.5255756479700944,3.53623260415547,3.546885930544293,3.557535633221919,3.5681817185182645,3.5788241930025166,3.5894630634779183,3.6000983369766244,3.610730020754625,3.6213581222867384,3.631982649261685,3.6426036095772103,3.6532210113352908,3.663834862837404,3.674445172579856,3.6850519492491935,3.695655201717657,3.706254939038728,3.7168511704427045,3.727443905332381,3.7380331532787547,3.748618924016818,3.7592012274414013,3.76978007360308,3.7803554727041413,3.7909274350946163,3.8014959712683534,3.812061091859181,3.822622807637098,3.8331811295045375,3.843736068492683,3.854287635757844,3.8648358425778824,3.8753807003486975,3.885922220580757,3.896460414895702,3.9069952950229823,3.917526872796554,3.928055160151634,3.9385801691214932,3.949101911834314,3.959620400510092,3.970135647457583,3.9806476650713036,3.9911564658285856,4.001662062286668,4.012164467079843,4.022663692916646,4.033159752577092,4.043652658909961,4.054142424830126,4.06462906331592,4.07511258740656,4.085593010199603,4.096070344848454,4.106544604559903,4.117015802591721,4.127483952250286,4.137949066888254,4.1484111599022615,4.15887024473069,4.169326334851446,4.17977944377979,4.190229585066207,4.200676772294308,4.211121019078775,4.221562339063337,4.232000745918792,4.242436253341042,4.252868875049205,4.263298624783716,4.273725516304496,4.284149563389132,4.294570779831115,4.304989179438083,4.315404776030125,4.32581758343809,4.336227615501953,4.346634886069193,4.35703940899322,4.367441198131809,4.377840267345588,4.388236630496541,4.398630301446547,4.4090212940559415,4.419409622182118,4.429795299678144,4.440178340391416,4.45055875816233,4.460936566822997,4.471311780195959,4.481684412092963,4.492054476313731,4.502421986644773,4.512786956858222,4.5231494007106905,4.533509331942154,4.543866764274856,4.55422171141224,4.564574187037903,4.574924204814574,4.5852717783831025,4.595616921361495,4.60595964734395,4.616299969899926,4.626637902573222,4.636973458881092,4.647306652313369,4.657637496331616,4.66796600436829,4.678292189825932,4.68861606607638,4.698937646459986,4.709256944284868,4.719573972826173,4.729888745325356,4.740201274989485,4.7505115749905595,4.7608196584648335,4.771125538512185,4.781429228195478,4.791730740539945,4.802030088532594,4.8123272851216266,4.822622343215869,4.8329152756842255,4.843206095355138,4.8534948150160755,4.863781447413019,4.874066005249977,4.884348501188509,4.894628947847261,4.904907357801519,4.915183743582775,4.925458117678301,4.935730492530749,4.946000880537752,4.956269294051541,4.966535745378576]},{\"type\":\"scatter\",\"line\":{\"shape\":\"linear\"},\"mode\":\"lines\",\"name\":\"Rational(x)\",\"x\":[-5,-4.99,-4.98,-4.97,-4.96,-4.95,-4.94,-4.93,-4.92,-4.91,-4.9,-4.89,-4.88,-4.87,-4.86,-4.85,-4.84,-4.83,-4.82,-4.81,-4.8,-4.79,-4.78,-4.77,-4.76,-4.75,-4.74,-4.73,-4.72,-4.71,-4.7,-4.69,-4.68,-4.67,-4.66,-4.65,-4.64,-4.63,-4.62,-4.61,-4.6,-4.59,-4.58,-4.57,-4.56,-4.55,-4.54,-4.53,-4.52,-4.51,-4.5,-4.49,-4.48,-4.47,-4.46,-4.45,-4.4399999999999995,-4.43,-4.42,-4.41,-4.4,-4.39,-4.38,-4.37,-4.36,-4.35,-4.34,-4.33,-4.32,-4.31,-4.3,-4.29,-4.28,-4.27,-4.26,-4.25,-4.24,-4.23,-4.22,-4.21,-4.2,-4.1899999999999995,-4.18,-4.17,-4.16,-4.15,-4.14,-4.13,-4.12,-4.11,-4.1,-4.09,-4.08,-4.07,-4.06,-4.05,-4.04,-4.03,-4.02,-4.01,-4,-3.99,-3.98,-3.9699999999999998,-3.96,-3.95,-3.94,-3.9299999999999997,-3.92,-3.91,-3.9,-3.8899999999999997,-3.88,-3.87,-3.86,-3.8499999999999996,-3.84,-3.83,-3.8200000000000003,-3.81,-3.8,-3.79,-3.7800000000000002,-3.77,-3.76,-3.75,-3.74,-3.73,-3.7199999999999998,-3.71,-3.7,-3.69,-3.6799999999999997,-3.67,-3.66,-3.65,-3.6399999999999997,-3.63,-3.62,-3.61,-3.5999999999999996,-3.59,-3.58,-3.5700000000000003,-3.56,-3.55,-3.54,-3.5300000000000002,-3.52,-3.51,-3.5,-3.49,-3.48,-3.4699999999999998,-3.46,-3.45,-3.44,-3.4299999999999997,-3.42,-3.41,-3.4,-3.3899999999999997,-3.38,-3.37,-3.36,-3.3499999999999996,-3.34,-3.33,-3.3200000000000003,-3.31,-3.3,-3.29,-3.2800000000000002,-3.27,-3.26,-3.25,-3.24,-3.23,-3.2199999999999998,-3.21,-3.2,-3.19,-3.1799999999999997,-3.17,-3.16,-3.15,-3.1399999999999997,-3.13,-3.12,-3.11,-3.0999999999999996,-3.09,-3.08,-3.0700000000000003,-3.06,-3.05,-3.04,-3.0300000000000002,-3.02,-3.01,-3,-2.9899999999999998,-2.98,-2.9699999999999998,-2.96,-2.95,-2.94,-2.93,-2.92,-2.91,-2.9,-2.89,-2.88,-2.87,-2.86,-2.85,-2.84,-2.83,-2.82,-2.81,-2.8,-2.79,-2.78,-2.77,-2.76,-2.75,-2.7399999999999998,-2.73,-2.7199999999999998,-2.71,-2.6999999999999997,-2.69,-2.68,-2.67,-2.66,-2.65,-2.64,-2.63,-2.62,-2.61,-2.6,-2.59,-2.58,-2.57,-2.56,-2.55,-2.54,-2.53,-2.52,-2.51,-2.5,-2.4899999999999998,-2.48,-2.4699999999999998,-2.46,-2.4499999999999997,-2.44,-2.43,-2.42,-2.41,-2.4,-2.39,-2.38,-2.37,-2.36,-2.35,-2.34,-2.33,-2.32,-2.31,-2.3,-2.29,-2.28,-2.27,-2.26,-2.25,-2.2399999999999998,-2.23,-2.2199999999999998,-2.21,-2.1999999999999997,-2.19,-2.18,-2.17,-2.16,-2.15,-2.14,-2.13,-2.12,-2.11,-2.1,-2.09,-2.08,-2.07,-2.06,-2.05,-2.04,-2.03,-2.02,-2.01,-2,-1.9899999999999998,-1.98,-1.9699999999999998,-1.96,-1.9499999999999997,-1.94,-1.9299999999999997,-1.92,-1.9100000000000001,-1.9,-1.8900000000000001,-1.88,-1.87,-1.8599999999999999,-1.85,-1.8399999999999999,-1.83,-1.8199999999999998,-1.81,-1.7999999999999998,-1.79,-1.7799999999999998,-1.77,-1.7599999999999998,-1.75,-1.7399999999999998,-1.73,-1.7199999999999998,-1.71,-1.6999999999999997,-1.69,-1.6799999999999997,-1.67,-1.6600000000000001,-1.65,-1.6400000000000001,-1.63,-1.62,-1.6099999999999999,-1.6,-1.5899999999999999,-1.58,-1.5699999999999998,-1.56,-1.5499999999999998,-1.54,-1.5299999999999998,-1.52,-1.5099999999999998,-1.5,-1.4899999999999998,-1.48,-1.4699999999999998,-1.46,-1.4499999999999997,-1.44,-1.4299999999999997,-1.42,-1.4100000000000001,-1.4,-1.3900000000000001,-1.38,-1.37,-1.3599999999999999,-1.35,-1.3399999999999999,-1.33,-1.3199999999999998,-1.31,-1.2999999999999998,-1.29,-1.2799999999999998,-1.27,-1.2599999999999998,-1.25,-1.2399999999999998,-1.23,-1.2199999999999998,-1.21,-1.1999999999999997,-1.19,-1.1799999999999997,-1.17,-1.1600000000000001,-1.15,-1.1400000000000001,-1.13,-1.12,-1.1099999999999999,-1.1,-1.0899999999999999,-1.08,-1.0699999999999998,-1.06,-1.0499999999999998,-1.04,-1.0299999999999998,-1.02,-1.0099999999999998,-1,-0.9900000000000002,-0.9799999999999995,-0.9699999999999998,-0.96,-0.9500000000000002,-0.9399999999999995,-0.9299999999999997,-0.9199999999999999,-0.9100000000000001,-0.9000000000000004,-0.8899999999999997,-0.8799999999999999,-0.8700000000000001,-0.8600000000000003,-0.8499999999999996,-0.8399999999999999,-0.8300000000000001,-0.8200000000000003,-0.8099999999999996,-0.7999999999999998,-0.79,-0.7800000000000002,-0.7699999999999996,-0.7599999999999998,-0.75,-0.7400000000000002,-0.7299999999999995,-0.7199999999999998,-0.71,-0.7000000000000002,-0.6899999999999995,-0.6799999999999997,-0.6699999999999999,-0.6600000000000001,-0.6499999999999995,-0.6399999999999997,-0.6299999999999999,-0.6200000000000001,-0.6100000000000003,-0.5999999999999996,-0.5899999999999999,-0.5800000000000001,-0.5700000000000003,-0.5599999999999996,-0.5499999999999998,-0.54,-0.5300000000000002,-0.5199999999999996,-0.5099999999999998,-0.5,-0.4900000000000002,-0.47999999999999954,-0.46999999999999975,-0.45999999999999996,-0.4500000000000002,-0.4399999999999995,-0.4299999999999997,-0.41999999999999993,-0.41000000000000014,-0.39999999999999947,-0.3899999999999997,-0.3799999999999999,-0.3700000000000001,-0.3600000000000003,-0.34999999999999964,-0.33999999999999986,-0.33000000000000007,-0.3200000000000003,-0.3099999999999996,-0.2999999999999998,-0.29000000000000004,-0.28000000000000025,-0.2699999999999996,-0.2599999999999998,-0.25,-0.2400000000000002,-0.22999999999999954,-0.21999999999999975,-0.20999999999999996,-0.20000000000000018,-0.1899999999999995,-0.17999999999999972,-0.16999999999999993,-0.16000000000000014,-0.14999999999999947,-0.13999999999999968,-0.1299999999999999,-0.1200000000000001,-0.11000000000000032,-0.09999999999999964,-0.08999999999999986,-0.08000000000000007,-0.07000000000000028,-0.05999999999999961,-0.04999999999999982,-0.040000000000000036,-0.03000000000000025,-0.019999999999999574,-0.009999999999999787,0,0.009999999999999787,0.020000000000000462,0.03000000000000025,0.040000000000000036,0.04999999999999982,0.0600000000000005,0.07000000000000028,0.08000000000000007,0.08999999999999986,0.10000000000000053,0.11000000000000032,0.1200000000000001,0.1299999999999999,0.13999999999999968,0.15000000000000036,0.16000000000000014,0.16999999999999993,0.17999999999999972,0.1900000000000004,0.20000000000000018,0.20999999999999996,0.21999999999999975,0.23000000000000043,0.2400000000000002,0.25,0.2599999999999998,0.27000000000000046,0.28000000000000025,0.29000000000000004,0.2999999999999998,0.3100000000000005,0.3200000000000003,0.33000000000000007,0.33999999999999986,0.35000000000000053,0.3600000000000003,0.3700000000000001,0.3799999999999999,0.3899999999999997,0.40000000000000036,0.41000000000000014,0.41999999999999993,0.4299999999999997,0.4400000000000004,0.4500000000000002,0.45999999999999996,0.46999999999999975,0.4800000000000004,0.4900000000000002,0.5,0.5099999999999998,0.5200000000000005,0.5300000000000002,0.54,0.5499999999999998,0.5600000000000005,0.5700000000000003,0.5800000000000001,0.5899999999999999,0.6000000000000005,0.6100000000000003,0.6200000000000001,0.6299999999999999,0.6399999999999997,0.6500000000000004,0.6600000000000001,0.6699999999999999,0.6799999999999997,0.6900000000000004,0.7000000000000002,0.71,0.7199999999999998,0.7300000000000004,0.7400000000000002,0.75,0.7599999999999998,0.7700000000000005,0.7800000000000002,0.79,0.7999999999999998,0.8100000000000005,0.8200000000000003,0.8300000000000001,0.8399999999999999,0.8500000000000005,0.8600000000000003,0.8700000000000001,0.8799999999999999,0.8899999999999997,0.9000000000000004,0.9100000000000001,0.9199999999999999,0.9299999999999997,0.9400000000000004,0.9500000000000002,0.96,0.9699999999999998,0.9800000000000004,0.9900000000000002,1,1.0099999999999998,1.0200000000000005,1.0300000000000002,1.04,1.0499999999999998,1.0600000000000005,1.0700000000000003,1.08,1.0899999999999999,1.1000000000000005,1.1100000000000003,1.12,1.13,1.1400000000000006,1.1500000000000004,1.1600000000000001,1.17,1.1799999999999997,1.1900000000000004,1.2000000000000002,1.21,1.2199999999999998,1.2300000000000004,1.2400000000000002,1.25,1.2599999999999998,1.2700000000000005,1.2800000000000002,1.29,1.2999999999999998,1.3100000000000005,1.3200000000000003,1.33,1.3399999999999999,1.3500000000000005,1.3600000000000003,1.37,1.38,1.3900000000000006,1.4000000000000004,1.4100000000000001,1.42,1.4299999999999997,1.4400000000000004,1.4500000000000002,1.46,1.4699999999999998,1.4800000000000004,1.4900000000000002,1.5,1.5099999999999998,1.5200000000000005,1.5300000000000002,1.54,1.5499999999999998,1.5600000000000005,1.5700000000000003,1.58,1.5899999999999999,1.6000000000000005,1.6100000000000003,1.62,1.63,1.6400000000000006,1.6500000000000004,1.6600000000000001,1.67,1.6799999999999997,1.6900000000000004,1.7000000000000002,1.71,1.7199999999999998,1.7300000000000004,1.7400000000000002,1.75,1.7599999999999998,1.7700000000000005,1.7800000000000002,1.79,1.7999999999999998,1.8100000000000005,1.8200000000000003,1.83,1.8399999999999999,1.8500000000000005,1.8600000000000003,1.87,1.88,1.8900000000000006,1.9000000000000004,1.9100000000000001,1.92,1.9299999999999997,1.9400000000000004,1.9500000000000002,1.96,1.9699999999999998,1.9800000000000004,1.9900000000000002,2,2.01,2.0200000000000005,2.0300000000000002,2.04,2.05,2.0600000000000005,2.0700000000000003,2.08,2.09,2.1000000000000005,2.1100000000000003,2.12,2.13,2.1400000000000006,2.1500000000000004,2.16,2.17,2.1799999999999997,2.1900000000000004,2.2,2.21,2.2199999999999998,2.2300000000000004,2.24,2.25,2.26,2.2700000000000005,2.2800000000000002,2.29,2.3,2.3100000000000005,2.3200000000000003,2.33,2.34,2.3500000000000005,2.3600000000000003,2.37,2.38,2.3900000000000006,2.4000000000000004,2.41,2.42,2.4299999999999997,2.4400000000000004,2.45,2.46,2.4699999999999998,2.4800000000000004,2.49,2.5,2.51,2.5200000000000005,2.5300000000000002,2.54,2.55,2.5600000000000005,2.5700000000000003,2.58,2.59,2.6000000000000005,2.6100000000000003,2.62,2.63,2.6400000000000006,2.6500000000000004,2.66,2.67,2.6799999999999997,2.6900000000000004,2.7,2.71,2.7199999999999998,2.7300000000000004,2.74,2.75,2.76,2.7700000000000005,2.7800000000000002,2.79,2.8,2.8100000000000005,2.8200000000000003,2.83,2.84,2.8500000000000005,2.8600000000000003,2.87,2.88,2.8900000000000006,2.9000000000000004,2.91,2.92,2.9300000000000006,2.9400000000000004,2.95,2.96,2.9699999999999998,2.9800000000000004,2.99,3,3.01,3.0199999999999996,3.0299999999999994,3.040000000000001,3.0500000000000007,3.0600000000000005,3.0700000000000003,3.08,3.09,3.0999999999999996,3.1099999999999994,3.120000000000001,3.130000000000001,3.1400000000000006,3.1500000000000004,3.16,3.17,3.1799999999999997,3.1899999999999995,3.1999999999999993,3.210000000000001,3.2200000000000006,3.2300000000000004,3.24,3.25,3.26,3.2699999999999996,3.2799999999999994,3.290000000000001,3.3000000000000007,3.3100000000000005,3.3200000000000003,3.33,3.34,3.3499999999999996,3.3599999999999994,3.370000000000001,3.380000000000001,3.3900000000000006,3.4000000000000004,3.41,3.42,3.4299999999999997,3.4399999999999995,3.4499999999999993,3.460000000000001,3.4700000000000006,3.4800000000000004,3.49,3.5,3.51,3.5199999999999996,3.5299999999999994,3.540000000000001,3.5500000000000007,3.5600000000000005,3.5700000000000003,3.58,3.59,3.5999999999999996,3.6099999999999994,3.620000000000001,3.630000000000001,3.6400000000000006,3.6500000000000004,3.66,3.67,3.6799999999999997,3.6899999999999995,3.700000000000001,3.710000000000001,3.7200000000000006,3.7300000000000004,3.74,3.75,3.76,3.7699999999999996,3.7799999999999994,3.790000000000001,3.8000000000000007,3.8100000000000005,3.8200000000000003,3.83,3.84,3.8499999999999996,3.8599999999999994,3.870000000000001,3.880000000000001,3.8900000000000006,3.9000000000000004,3.91,3.92,3.9299999999999997,3.9399999999999995,3.950000000000001,3.960000000000001,3.9700000000000006,3.9800000000000004,3.99,4,4.01,4.02,4.029999999999999,4.040000000000001,4.050000000000001,4.0600000000000005,4.07,4.08,4.09,4.1,4.109999999999999,4.120000000000001,4.130000000000001,4.140000000000001,4.15,4.16,4.17,4.18,4.1899999999999995,4.200000000000001,4.210000000000001,4.220000000000001,4.23,4.24,4.25,4.26,4.27,4.279999999999999,4.290000000000001,4.300000000000001,4.3100000000000005,4.32,4.33,4.34,4.35,4.359999999999999,4.370000000000001,4.380000000000001,4.390000000000001,4.4,4.41,4.42,4.43,4.4399999999999995,4.450000000000001,4.460000000000001,4.470000000000001,4.48,4.49,4.5,4.51,4.52,4.529999999999999,4.540000000000001,4.550000000000001,4.5600000000000005,4.57,4.58,4.59,4.6,4.609999999999999,4.620000000000001,4.630000000000001,4.640000000000001,4.65,4.66,4.67,4.68,4.6899999999999995,4.700000000000001,4.710000000000001,4.720000000000001,4.73,4.74,4.75,4.76,4.77,4.779999999999999,4.790000000000001,4.800000000000001,4.8100000000000005,4.82,4.83,4.84,4.85,4.859999999999999,4.870000000000001,4.880000000000001,4.890000000000001,4.9,4.91,4.92,4.93,4.9399999999999995,4.950000000000001,4.960000000000001,4.970000000000001,4.98,4.99,5],\"y\":[-0.02112013274246287,-0.021383206456761828,-0.021649246921126068,-0.021918269864948443,-0.02219029097887195,-0.022465325913683772,-0.022743390279198573,-0.023024499643119874,-0.02330866952989344,-0.023595915419537605,-0.02388625274646371,-0.02417969689827656,-0.024476263214560093,-0.024775966985644975,-0.025078823451364276,-0.025384847799783884,-0.02569405516592423,-0.0260064606304578,-0.02632207921839414,-0.02664092589774436,-0.026963015578166976,-0.027288363109598028,-0.027616983280860884,-0.02794889081825591,-0.028284100384134796,-0.028622626575453402,-0.02896448392230448,-0.029309686886431974,-0.029658249859725334,-0.03001018716269334,-0.030365513042916216,-0.030724241673479938,-0.031086387151387715,-0.03145196349594803,-0.031820984647147554,-0.03219346446399633,-0.03256941672285152,-0.0329488551157249,-0.033331793248558686,-0.033718244639486486,-0.03410822271706783,-0.03450174081849842,-0.03489881218779799,-0.03529944997397645,-0.03570366722917189,-0.0361114769067661,-0.03652289185947708,-0.036937924837423204,-0.03735658848616437,-0.03777889534471741,-0.03820485784354451,-0.03863448830251739,-0.039067798928852863,-0.03950480181502381,-0.03994550893664114,-0.040389932150310365,-0.04083808319145893,-0.04128997367213679,-0.041745615078788566,-0.04220501876999555,-0.042668195974192163,-0.04313515778735144,-0.043605915170638214,-0.04408047894804009,-0.044558859803959246,-0.04504106828078156,-0.04552711477641012,-0.04601700954177088,-0.04651076267828384,-0.047008384135306724,-0.04750988370754302,-0.04801527103241949,-0.04852455558743105,-0.04903774668745296,-0.04955485348201968,-0.05007588495256866,-0.050600849909654314,-0.051129756990122996,-0.05166261465425711,-0.05219943118288329,-0.052740214674446124,-0.053284973042043604,-0.05383371401043134,-0.05438644511298918,-0.054943173688649004,-0.05550390687878915,-0.056068651624091054,-0.05663741466135747,-0.0572102025202945,-0.05778702152025673,-0.05836787776694968,-0.05895277714910075,-0.05954172533508588,-0.060134727769519405,-0.060731789669804366,-0.061332916022644055,-0.061938111580512545,-0.06254738085808574,-0.06316072812863177,-0.06377815742036001,-0.06439967251273188,-0.0650252769327276,-0.06565497395107246,-0.06628876657842203,-0.0669266575615044,-0.06756864937922147,-0.06821474423870748,-0.06886494407134354,-0.06951925052873141,-0.07017766497862345,-0.07084018850080881,-0.07150682188295726,-0.07217756561641837,-0.07285241989197698,-0.07353138459556628,-0.07421445930393442,-0.07490164328026827,-0.07559293546977296,-0.0762883344952066,-0.07698783865236902,-0.07769144590554812,-0.07839915388291932,-0.07911095987190181,-0.07982686081446741,-0.08054685330240757,-0.08127093357255177,-0.08199909750194387,-0.08273134060297044,-0.08346765801844665,-0.08420804451665508,-0.08495249448633888,-0.08570100193165295,-0.08645356046706648,-0.08721016331222196,-0.08797080328675086,-0.08873547280504113,-0.08950416387096304,-0.09027686807254921,-0.09105357657663014,-0.09183428012342726,-0.09261896902109941,-0.09340763314024751,-0.09420026190837517,-0.09499684430430681,-0.0957973688525614,-0.0966018236176857,-0.09741019619854296,-0.09822247372256258,-0.09903864283994449,-0.09985868971782738,-0.10068260003441251,-0.10151035897304868,-0.10234195121627827,-0.10317736093984331,-0.10401657180665408,-0.10485956696071774,-0.10570632902103369,-0.1065568400754477,-0.10741108167447325,-0.10826903482507728,-0.10913067998443032,-0.1099959970536239,-0.11086496537135493,-0.11173756370757917,-0.1126137702571315,-0.11349356263331803,-0.11437691786147862,-0.11526381237252002,-0.11615422199642506,-0.11704812195573135,-0.11794548685898927,-0.11884629069419463,-0.11975050682219779,-0.12065810797009395,-0.1215690662245914,-0.12248335302536235,-0.12340093915837626,-0.124321794749218,-0.1252458892563898,-0.12617319146460276,-0.1271036694780569,-0.12803729071370917,-0.1289740218945368,-0.12991382904279192,-0.1308566774732528,-0.1318025317864732,-0.13275135586202866,-0.13370311285176656,-0.1346577651730559,-0.13561527450204627,-0.13657560176693026,-0.13753870714121605,-0.1385045500370133,-0.1394730890983296,-0.1404442821943836,-0.1414180864129383,-0.14239445805365147,-0.1433733526214514,-0.14435472481993622,-0.14533852854480267,-0.14632471687730314,-0.14731324207773744,-0.14830405557898,-0.14929710798004314,-0.15029234903968516,-0.15128972767005822,-0.15228919193040652,-0.1532906890208105,-0.15429416527598808,-0.15529956615914609,-0.1563068362558951,-0.15731591926822222,-0.15832675800853185,-0.15933929439375083,-0.16035346943950846,-0.16136922325438838,-0.16238649503425878,-0.16340522305668453,-0.1644253446754215,-0.16544679631500187,-0.16646951346540795,-0.16749343067684147,-0.1685184815545925,-0.16954459875400732,-0.17057171397556417,-0.17159975796005628,-0.17262866048388822,-0.17365835035448743,-0.1746887554058367,-0.17571980249412797,-0.17675141749354573,-0.17778352529217856,-0.17881604978806626,-0.17984891388538557,-0.1808820394907756,-0.18191534750981064,-0.1829487578436203,-0.1839821893856637,-0.18501556001865832,-0.18604878661167035,-0.1870817850173668,-0.18811447006943666,-0.18914675558018004,-0.190178554338274,-0.19120977810671308,-0.19224033762093368,-0.19327014258711947,-0.19429910168069775,-0.19532712254502235,-0.1963541117902553,-0.19737997499244128,-0.19840461669278492,-0.19942794039712902,-0.20044984857564035,-0.2014702426627026,-0.202489023057022,-0.203506089121945,-0.20452133918599347,-0.20553467054361835,-0.20654597945617284,-0.20755516115310985,-0.2085621098334032,-0.20956671866719562,-0.2105688797976746,-0.2115684843431778,-0.21256542239952966,-0.2135595830426096,-0.21455085433115206,-0.21553912330978325,-0.21652427601228763,-0.2175061974651126,-0.21848477169110592,-0.21945988171348776,-0.22043140956005747,-0.22139923626763375,-0.2223632418867272,-0.22332330548644477,-0.2242793051596257,-0.2252311180282043,-0.22617862024880145,-0.22712168701854002,-0.2280601925810831,-0.22899401023289193,-0.22992301232969992,-0.23084707029320028,-0.23176605461794428,-0.23267983487844277,-0.2335882797364714,-0.23449125694857084,-0.23538863337373978,-0.23628027498131265,-0.23716604685901915,-0.2380458132212172,-0.23891943741729393,-0.23978678194022765,-0.24064770843530375,-0.24150207770897536,-0.24234974973786338,-0.2431905836778848,-0.24402443787350261,-0.24485116986708466,-0.24567063640836723,-0.2464826934640069,-0.24728719622721435,-0.24808399912745846,-0.24887295584022656,-0.24965391929683295,-0.2504267416942604,-0.2511912745050224,-0.25194736848703325,-0.25269487369347365,-0.25343363948263375,-0.25416351452772334,-0.25488434682663186,-0.25559598371162245,-0.2562982718589458,-0.2569910572983545,-0.2576741854225045,-0.2583475009962243,-0.25901084816563247,-0.2596640704670898,-0.2603070108359627,-0.2609395116151815,-0.26156141456357285,-0.2621725608639478,-0.2627727911309219,-0.26336194541845015,-0.26393986322705354,-0.26450638351071515,-0.2650613446834249,-0.2656045846253499,-0.266135940688607,-0.266655249702615,-0.2671623479790028,-0.26765707131604877,-0.2681392550026274,-0.268608733821639,-0.269065342052896,-0.26950891347544115,-0.2699392813692734,-0.2703562785164519,-0.270759737201555,-0.2711494892114655,-0.2715253658344571,-0.27188719785855275,-0.2722348155691286,-0.27256804874573587,-0.27288672665811253,-0.27319067806135605,-0.27347973119022945,-0.27375371375257224,-0.27401245292178633,-0.27425577532837014,-0.27448350705046765,-0.2746954736034091,-0.2748914999282082,-0.27507141037898947,-0.2752350287093152,-0.2753821780573827,-0.2755126809300606,-0.2756263591857353,-0.27572303401593884,-0.27580252592572424,-0.27586465471276156,-0.275909239445124,-0.2759360984377316,-0.27594504922742397,-0.27593590854663214,-0.27590849229561765,-0.2758626155132485,-0.275798092346283,-0.27571473601712976,-0.27561235879005364,-0.27549077193579663,-0.27534978569458535,-0.2751892092374903,-0.27500885062611147,-0.2748085167705554,-0.2745880133856759,-0.2743471449455461,-0.27408571463613157,-0.2738035243061348,-0.2735003744159781,-0.2731760639848961,-0.27283039053610536,-0.2724631500400217,-0.2720741368554914,-0.27166314366900757,-0.2712299614318792,-0.27077437929532,-0.2702961845434277,-0.2697951625240188,-0.2692710965772891,-0.26872376796226505,-0.26815295578101445,-0.267558436900582,-0.26693998587261797,-0.26629737485066285,-0.265630373505056,-0.264938748935432,-0.2642222655807686,-0.2634806851269514,-0.2627137664118168,-0.2619212653276367,-0.2611029347210056,-0.2602585242900921,-0.2593877804792133,-0.25849044637069235,-0.2575662615739566,-0.2566149621118325,-0.25563628030399477,-0.2546299446475228,-0.2535956796945188,-0.2525332059267377,-0.2514422396271821,-0.2503224927486085,-0.24917367277889377,-0.24799548260320664,-0.24678762036292806,-0.24554977931126273,-0.24428164766548113,-0.2429829084557298,-0.24165323937034533,-0.24029231259760556,-0.2388997946638481,-0.2374753462678844,-0.2360186221116341,-0.2345292707269041,-0.23300693429822955,-0.23145124848169274,-0.22986184221963654,-0.22823833755117753,-0.22658034941842842,-0.22488748546832893,-0.22315934584998648,-0.2213955230074186,-0.21959560146758852,-0.21775915762361756,-0.21588575951305827,-0.21397496659110116,-0.21202632949858652,-0.21003938982469028,-0.20801367986413735,-0.20594872236880377,-0.20384403029355128,-0.20169910653613865,-0.1995134436710436,-0.19728652367702573,-0.19501781765825144,-0.1927067855587947,-0.19035287587032035,-0.18795552533274942,-0.18551415862769569,-0.1830281880644561,-0.1804970132583252,-0.1779200208010005,-0.17529658392282824,-0.1726260621466359,-0.1699078009328796,-0.16714113131583247,-0.16432536953051993,-0.16145981663010206,-0.15854375809338456,-0.15557646342213402,-0.15255718572785368,-0.14948516130766226,-0.14635960920890903,-0.1431797307821318,-0.13994470922196212,-0.1366537090955527,-0.13330587585809356,-0.12990033535495576,-0.1264361933099937,-0.12291253479950577,-0.11932842371134124,-0.11568290218860872,-0.11197499005743253,-0.10820368423816586,-0.10436795813945408,-0.10046676103450644,-0.09649901741891824,-0.092463626349345,-0.08835946076231027,-0.08418536677238539,-0.07994016294896192,-0.07562263957078723,-0.07123155785741032,-0.06676564917663362,-0.06222361422704297,-0.05760412219463084,-0.0529058098824923,-0.048127280812527894,-0.0432671042980298,-0.038323814485992154,-0.03329590936791789,-0.028181849757850423,-0.022980058236286773,-0.017688918058583327,-0.012306772026384041,-0.00683192132054498,-0.0012626242939438315,0.004373779463280628,0.010032373248762395,0.015713688338110147,0.021418247126253044,0.02714656320673467,0.032899141445184535,0.03867647804722736,0.044479060621096175,0.05030736823518911,0.056161871470821134,0.062043032470399724,0.067951304981262,0.07388713439538563,0.0798509577851971,0.08584320393568612,0.09186429337302787,0.09791463838992105,0.10399464306782549,0.11010470329629772,0.11624520678960262,0.12241653310079062,0.12861905363340553,0.13485313165100313,0.14111912228464257,0.14741737253852233,0.15374822129391053,0.16011199931153405,0.16650902923257307,0.17293962557841877,0.17940409474932892,0.18590273502213292,0.19243583654711846,0.1990036813442442,0.20560654329880132,0.2122446881566609,0.21891837351922763,0.22562784883823248,0.2323733554104734,0.2391551263726288,0.24597338669625732,0.2528283531830901,0.2597202344607359,0.2666492309788889,0.27361553500615493,0.28061933062758604,0.28766079374303166,0.2947400920663861,0.3018573851258344,0.30901282426517773,0.31620655264632996,0.3234387052530589,0.33070940889605843,0.3380187822194216,0.3453669357085969,0.35275397169988526,0.3601799843915551,0.36764505985663204,0.3751492760574344,0.38269270286189877,0.3902754020617613,0.39789742739264,0.40555882455607506,0.41325963124356074,0.42099987716262205,0.4287795840649716,0.43659876577677936,0.4444574282310982,0.4523555695024662,0.4602931798437166,0.4682702417250179,0.47628672987517207,0.48434261132517753,0.4924378454540799,0.5005723840371192,0.5087461712961867,0.5169591439525898,0.5252112312821352,0.5335023551725239,0.5418324301830642,0.5502013636066863,0.5586090555342571,0.5670553989211795,0.5755402796562687,0.5840635766328797,0.5926251618222721,0.6012249003491869,0.6098626505696171,0.6185382641507347,0.6272515861529495,0.6360024551140723,0.6447907031355332,0.6536161559706398,0.6624786331148136,0.6713779478977799,0.6803139075776541,0.6892863134368968,0.6982949608800699,0.7073396395333595,0.7164201333458027,0.7255362206921812,0.7346876744775086,0.7438742622430693,0.753095746273939,0.7623518837079455,0.7716424266459911,0.780967122263683,0.7903257129242078,0.7997179362923925,0.8091435254498738,0.818602209011322,0.8280937112416429,0.8376177521741046,0.8471740477293038,0.8567623098349144,0.8663822465461439,0.8760335621668374,0.8857159573711455,0.8954291293256945,0.9051727718121911,0.9149465753503815,0.9247502273213094,0.9345834120907889,0.9444458111330278,0.9543371031543338,0.9642569642168369,0.9742050678621464,0.9841810852348909,0.9941846852060591,1.004215534496088,1.0142732977976194,1.0243576378978674,1.0344682158005256,1.0446046908471631,1.0547667208380274,1.064953962152209,1.0751660698670955,1.0854026978770672,1.0956634990113616,1.1059481251510637,1.1162562273451508,1.1265874559255578,1.1369414606211863,1.147317890670825,1.1577163949349187,1.1681366220061427,1.1785782203187354,1.18904083825654,1.199524124259713,1.2100277269300537,1.2205512951349216,1.2310944781096946,1.241656925558729,1.2522382877547897,1.262838215636918,1.273456360906697,1.2840923761228886,1.294745914794407,1.3054166314716102,1.3161041818358774,1.3268082227874418,1.3375284125314661,1.3482644106623414,1.359015878246173,1.369782477901456,1.3805638738779078,1.3913597321334565,1.402169720409361,1.4129935083034568,1.4238307673415216,1.4346811710467366,1.4455443950072626,1.4564201169419,1.467308016763845,1.4782077766425288,1.4891190810635537,1.500041616886711,1.5109750734020915,1.5219191423842833,1.532873518144681,1.5438378975818854,1.5548119802302232,1.5657954683063735,1.5767880667541432,1.5877894832873587,1.5987994284309273,1.6098176155600448,1.6208437609375994,1.6318775837497512,1.6429188061397284,1.653967153239843,1.6650223532017565,1.6760841372249953,1.6871522395837553,1.6982263976520005,1.7093063519268807,1.7203918460505014,1.731482626830045,1.7425784442562857,1.7536790515205114,1.7647842050298868,1.7758936644212615,1.7870071925734792,1.798124555618175,1.8092455229491289,1.8203698672301636,1.8314973644016377,1.8426277936855477,1.8537609375892805,1.8648965819080265,1.8760345157258935,1.887174531415736,1.8983164246377553,1.909459994336861,1.920605042738856,1.931751375345445,1.9428988009281223,1.954047131520946,1.9651961824122355,1.9763457721352244,1.9874957224576828,1.9986458583705662,2.0097960080756785,2.0209460029724213,2.0320956776436114,2.0432448698404464,2.0543934204665963,2.065541173561485,2.0766879762827624,2.087833678888024,2.098978134715771,2.110121200165669,2.1212627346781017,2.1324026007130796,2.1435406637284995,2.154676792157793,2.165810857386993,2.1769427337312375,2.1880722984107392,2.1991994315262358,2.2103240160339555,2.2214459377201243,2.232565085175023,2.2436813497666295,2.254794625613864,2.265904809559459,2.2770118011424847,2.2881155025705318,2.2992158186915956,2.310312656965658,2.3214059274360177,2.3324955427003546,2.343581417881573,2.354663470598428,2.3657416209359696,2.3768157914157975,2.3878859069661718,2.3989518948919764,2.410013684844561,2.421071208791483,2.43212440098615,2.44317319793739,2.4542175383789675,2.465257363239053,2.476292615609656,2.4873232407160475,2.4983491858861826,2.5093704005201256,2.5203868360595076,2.5313984459570134,2.542405185645915,2.5534070125096773,2.5644038858516174,2.5753957668646628,2.586382618601184,2.597364405942946,2.6083410955711672,2.619312655936696,2.630279057230319,2.64124027135322,2.652196271887574,2.6631470340673045,2.6740925347490028,2.685032752383025,2.6959676669847576,2.7068972601060852,2.7178215148070275,2.7287404156276,2.7396539485598645,2.750562101020192,2.7614648618217448,2.77236222114718,2.7832541705215776,2.7941407027855947,2.8050218120688633,2.8158974937636194,2.8267677444985857,2.837632562113083,2.848491945631411,2.859345895237466,2.870194412249633,2.8810374990959096,2.8918751592893264,2.9027073974035913,2.9135342190490388,2.9243556308488103,2.9351716404153394,2.9459822563270746,2.956787488105498,2.9675873461924094,2.978381841927478,2.989170987526084,2.999954796057426,3.0107332814228975,3.021506458334764,3.0322743422950986,3.043036949574994,3.053794297194064,3.0645464029002127,3.0752932851496846,3.086034963087388,3.0967714565274984,3.1075027859343356,3.118228972403516,3.1289500376433756,3.1396660039566697,3.150376894222546,3.16108273187878,3.171783540904296,3.182479345801936,3.1931701715815057,3.203856043743097,3.214536988260658,3.225213031565828,3.2358842005320434,3.246550522458888,3.2572120250567194,3.2678687364315344,3.2785206850700854,3.289167899825276,3.2998104099017738,3.310448244841889,3.321081434511694,3.331710009087385,3.3423339990418914,3.352953435131713,3.3635683483840126,3.3741787700839128,3.384784731762066,3.395386265182421,3.4059834023302287,3.4165761754002824,3.42716461678536,3.4377487590649163,3.4483286349939637,3.4589042774921848,3.4694757196332646,3.480042994634416,3.4906061358461296,3.50116517674212,3.5117201509094795,3.5222710920390337,3.5328180339158974,3.5433610104102176,3.553900055468123,3.564435203102862,3.574966487386115,3.585493942439519,3.596017602426348,3.6065375015434022,3.6170536740130554,3.6275661540754776,3.6380749759810653,3.6485801739829915,3.659081782329972,3.6695798352591678,3.6800743669892673,3.690565411713726,3.701053003594166,3.7115371767539322,3.7220179652718013,3.7324954031758595,3.742969524437499,3.753440362965597,3.7639079526008143,3.774372327110051,3.784833520181046,3.7952915654170987,3.8057464963319445,3.816198346344761,3.8266471487752995,3.8370929368391544,3.8475357436431588,3.8579756021809013,3.868412545328376,3.878846605839746,3.8892778163432262,3.899706209337094,3.9101318171858064,3.9205546721162308,3.9309748062139933,3.9413922514199333,3.9518070395266616,3.9622192021752354,3.972628770851927,3.9830357768850964,3.993440251442175,4.00384222552673,4.014241729975641,4.02463879545636,4.035033452464272,4.0454257313201465,4.055815662167679,4.066203274971105,4.0765885995129345,4.086971665391734,4.0973525020200166,4.1077311386222,4.11810760423266,4.128481927693832,4.1388541376544286,4.149224262567704,4.1595923306898,4.169958370078171,4.180322408590072,4.190684473881112,4.201044593403893,4.211402794406693,4.221759103932233,4.2321135488165025,4.242466155687627,4.252816950964845,4.263165960857487,4.273513211364061,4.283858728271361,4.294202537153656,4.30454466337192,4.3148851320731225,4.325223968189564,4.335561196438275,4.345896841320448,4.356230927120944,4.366563477907817,4.376894517531912,4.387224069626483,4.397552157606892,4.407878804670308,4.418204033795484,4.428527867742556,4.438850329052899,4.449171440048999,4.459491222834392,4.469809699293619,4.4801268910922305,4.490442819676824,4.500757506275103,4.511070971896006,4.521383237329828,4.531694323148401,4.542004249705297,4.552313037136062,4.562620705358484,4.5729272740728915,4.583232762762465,4.593537190693607,4.603840576916307,4.614142940264561,4.624444299356785,4.634744672596291,4.6450440781717575,4.6553425340577395,4.665640058015189,4.675936667592016,4.686232380123658,4.69652721273367,4.706821182334343,4.717114305627338,4.727406599104336,4.737698079047717,4.74798876153125,4.758278662420792,4.768567797375027,4.778856181846205,4.789143831080895,4.7994307601207655,4.809716983803368,4.820002516762953,4.830287373431269,4.8405715680384125,4.850855114613662,4.861138026986342,4.871420318786688,4.881702003446735,4.8919830942012,4.902263604088399,4.912543545951157,4.922822932437725,4.933101776002731,4.943380088908108,4.953657883224067,4.963935170830034]}],\"layout\":{\"title\":{\"text\":\"Target vs Learned\"},\"xaxis\":{\"showgrid\":true},\"yaxis\":{\"showgrid\":true}}}');\n",
       "\tmodule.newPlot('c011168b', data);\n",
       "\n",
       "\t}\n",
       "\t\n",
       "    if (typeof requirejs === \"function\") {\n",
       "        // Use RequireJS to load module.\n",
       "\t\tlet srcWithoutExtension = src.substring(0, src.lastIndexOf(\".js\"));\n",
       "        requirejs.config({\n",
       "            paths: {\n",
       "                'plotly': srcWithoutExtension\n",
       "            }\n",
       "        });\n",
       "        require(['plotly'], function(plotly) {\n",
       "            runJSFn(plotly)\n",
       "        });\n",
       "        return\n",
       "    }\n",
       "\n",
       "\tvar currentScripts = document.head.getElementsByTagName(\"script\");\n",
       "\tfor (const idx in currentScripts) {\n",
       "\t\tlet script = currentScripts[idx];\n",
       "\t\tif (script.src == src) {\n",
       "\t\t\trunJSFn(null);\n",
       "\t\t\treturn;\n",
       "\t\t}\n",
       "\t}\n",
       "\n",
       "\tvar script = document.createElement(\"script\");\n",
       "\n",
       "\tscript.charset = \"utf-8\";\n",
       "\t\n",
       "\tscript.src = src;\n",
       "\tscript.onload = script.onreadystatechange = function () { runJSFn(null); };\n",
       "\tdocument.head.appendChild(script);\t\n",
       "})();\n",
       "</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cache entry line:\n",
      "\n",
      "\t\tinitCacheKey{Approximation: \"swish\", Version: \"B\", NumeratorDegree: 6, DenominatorDegree: 5}: &initCacheValue{\n",
      "\t\t\tNum: []float64{-0.0012626242939438315, 0.5621299881691898, 0.2948359391204854, 0.13423005084150424, 0.038218664721966625, 0.00499405512353664, 0.0002334292300551995},\n",
      "\t\t\tDen: []float64{-0.3317051900332943, -0.013564178055387946, -0.07887396541471477, 0.0003131085291739652, -0.00046738201074876176},\n",
      "\t\t\tGainEstimate: 2.8132747357829495},\n"
     ]
    }
   ],
   "source": [
    "func swish(ctx *context.Context, x *Node) (string, *Node) {\n",
    "    return \"Swish(x)\", activations.Swish(x)\n",
    "}\n",
    "\n",
    "%%\n",
    "BatchSize=50_000\n",
    "NumSteps=100_000\n",
    "GenerateRationalCacheLine(\"swish\", swish, 6, 5, \"B\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b906d60b-3b88-4a17-9699-f598a7942c55",
   "metadata": {},
   "source": [
    "## Reading from `rationals_config.json`\n",
    "\n",
    "It takes as input the file downloaded from [github.com/ml-research/rational_activations/rational/rationals_config.json](https://github.com/ml-research/rational_activations/blob/master/rational/rationals_config.json)\n",
    "\n",
    "It outputs the various configurations that can be copy&pasted to Go."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "410abb9e-3805-451f-a4cd-d0726eb27dfd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "n1=identity -> {Numerator:[0 1 0 0 0 0] Denominator:[0 0 0 0] UpperBound:-3 LowerBound:3}\n",
      "\tinitCacheKey{Approximation:\"sigmoid\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.5000000002774382, 0.2500039727332485, 0.05544474230118124, 0.006888449237990345, 0.00048491391666921244, 1.5646015289718136e-05}\n",
      "\t\tDenominatorCoefficients: []float64{7.956371345839366e-06, 0.11088550952772189, 7.76547864226066e-07, 0.0009697684428133153}},\n",
      "\tinitCacheKey{Approximation:\"relu\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.033897129202224346, 0.4999985439606278, 1.6701363611130988, 1.9901021632350815, 0.9413089613384323, 0.1509133373584318}\n",
      "\t\tDenominatorCoefficients: []float64{-2.1040152094202414e-05, 3.980247851167207, -3.166344237241501e-05, 0.30183382300945066}},\n",
      "\tinitCacheKey{Approximation:\"swish\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{3.054879741161051e-07, 0.5000007853744493, 0.24999783422824703, 0.05326628273219478, 0.005803034571292244, 0.0002751961022402342}\n",
      "\t\tDenominatorCoefficients: []float64{-4.111554955950634e-06, 0.10652899335007572, -1.2690007399796238e-06, 0.0005502331264140556}},\n",
      "skipping \"identity\"\n",
      "\tinitCacheKey{Approximation:\"identity\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0, 1, 0, 0, 0, 0}\n",
      "\t\tDenominatorCoefficients: []float64{0.9, 0, 0, 0, 0}},\n",
      "\tinitCacheKey{Approximation:\"identity\", Version:\"N\", NumeratorDegree:2, DenominatorDegree:2}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{2.0768813552409573e-20, 0.9999999997812081, 0.0006867760240578934}\n",
      "\t\tDenominatorCoefficients: []float64{0.0006867760240050522, -1.4587398861117518e-11}},\n",
      "\tinitCacheKey{Approximation:\"sigmoid\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.5000000002774382, 0.2500039727332485, 0.05544474230118124, 0.006888449237990345, 0.00048491391666921244, 1.5646015289718136e-05}\n",
      "\t\tDenominatorCoefficients: []float64{7.956371345839366e-06, 0.11088550952772189, 7.76547864226066e-07, 0.0009697684428133153}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"B\", NumeratorDegree:7, DenominatorDegree:6}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.01964840427008628, 0.8663826315551684, 6.171795038916364, 17.115491923105473, 22.193921388440426, 14.340632785553574, 4.445676524738527, 0.5371403305595667}\n",
      "\t\tDenominatorCoefficients: []float64{7.010335862486178, 13.809752918048835, 23.82775258043521, 16.51163509824627, 2.5658857005547717, 0.9068983776485914}},\n",
      "\tinitCacheKey{Approximation:\"tanh\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-1.0804622559204184e-08, 1.0003008043819048, -2.5878199375289335e-08, 0.09632129918392647, 3.4775841628196104e-09, 0.0004255709234726337}\n",
      "\t\tDenominatorCoefficients: []float64{-0.0013027181209176277, 0.428349017422072, 1.4524304083061898e-09, 0.010796648111337176}},\n",
      "\tinitCacheKey{Approximation:\"silu\", Version:\"N\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{3.266881610395981e-07, 0.49999999081326113, 0.24997332715914988, 0.05325340025674068, 0.0058003403315322, 0.00027497533639232177}\n",
      "\t\tDenominatorCoefficients: []float64{-4.80777614312505e-05, 0.10653079960025053, -4.663835554309269e-06, 0.0005503029408021047}},\n",
      "\tinitCacheKey{Approximation:\"identity\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0, 1, 0, 0, 0, 0}\n",
      "\t\tDenominatorCoefficients: []float64{0, 0, 0, 0}},\n",
      "\tinitCacheKey{Approximation:\"relu\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.033897129202224346, 0.4999985439606278, 1.6701363611130988, 1.9901021632350815, 0.9413089613384323, 0.1509133373584318}\n",
      "\t\tDenominatorCoefficients: []float64{-2.1040152094202414e-05, 3.980247851167207, -3.166344237241501e-05, 0.30183382300945066}},\n",
      "\tinitCacheKey{Approximation:\"tanh\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{2.1172949817857366e-09, 0.9999942495075363, 6.276332768876106e-07, 0.10770864506559906, 2.946556898117109e-08, 0.000871124373591946}\n",
      "\t\tDenominatorCoefficients: []float64{6.376908337817277e-07, 0.44101418051922986, 2.2747661404467182e-07, 0.014581039909092108}},\n",
      "\tinitCacheKey{Approximation:\"sigmoid\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.4999992534599381, 0.25002157564685185, 0.14061924500301096, 0.049420492431596394, 0.00876714851885483, 0.0006442412789159799}\n",
      "\t\tDenominatorCoefficients: []float64{2.1694506382753683e-09, 0.28122766100417684, 1.0123620714203357e-05, 0.017531988049946}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.029792778657264946, 0.6183735264987601, 2.323309062531321, 3.051936237265109, 1.4854203263828845, 0.2510244961111299}\n",
      "\t\tDenominatorCoefficients: []float64{-1.1419548357285474, 4.393159974992486, 0.8714712309957245, 0.34719662339598834}},\n",
      "\tinitCacheKey{Approximation:\"gelu\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-0.06332215990776038, 75.00371336515258, 60.40299979439254, 11.046215295208759, -1.944610878554029, -0.5613502889957269}\n",
      "\t\tDenominatorCoefficients: []float64{149.90738995374193, -0.00414880098336288, 22.09585877904437, -0.0009128752792880584, -1.122625040450191}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.863943144302673, 13.001131096231564, 42.56763919941753, 51.74757697869782, 23.99165145314087, 3.924120833060723}\n",
      "\t\tDenominatorCoefficients: []float64{25.644974747512343, -0.0013495866374991824, 102.47308203485366, -0.0017931970367811253, 7.77090005615082}},\n",
      "\tinitCacheKey{Approximation:\"gelu\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-0.0004221071456647063, 0.49999955516606254, 0.40270535451115536, 0.07366976895222031, -0.012954788054484537, -0.0037414002583076983}\n",
      "\t\tDenominatorCoefficients: []float64{4.9585381197087913e-05, 0.1472977407631199, 1.1645825701440633e-05, -0.007483871514842074}},\n",
      "\tinitCacheKey{Approximation:\"swish\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{3.2597006782059475e-07, 0.500000007624051, 0.2500169540800127, 0.05327519598927768, 0.005804580590860159, 0.00027529600705133663}\n",
      "\t\tDenominatorCoefficients: []float64{3.917294261258692e-05, 0.1065308384054887, 3.7991514117509955e-06, 0.0005503052126186067}},\n",
      "\tinitCacheKey{Approximation:\"gelu\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-0.0012423594497499122, 0.5080497063245629, 0.41586363182937475, 0.13022718688035761, 0.024355900098993424, 0.00290283948155535}\n",
      "\t\tDenominatorCoefficients: []float64{-0.06675015696494944, 0.17927646217001553, 0.03746682605496631, 1.6561610853276082e-10}},\n",
      "skipping \"Rational_version_A5/4.leaky_relu_0.1\"\n",
      "\tinitCacheKey{Approximation:\"relu\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.7865035431863266, 11.601593145754968, 38.7535199511595, 46.17884158100411, 21.842701976543186, 3.501924367528041}\n",
      "\t\tDenominatorCoefficients: []float64{23.103140929589287, 0.0004299501319296557, 92.356987965797, 0.000308676388304253, 7.003817416523842}},\n",
      "\tinitCacheKey{Approximation:\"tanh\", Version:\"N\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-3.145423530423389e-09, 0.9999942494014291, -1.9721597767154503e-06, 0.10770862804964325, -9.136256462122441e-08, 0.0008711236928997527}\n",
      "\t\tDenominatorCoefficients: []float64{-2.0011607852015447e-06, 0.44101416266969534, -7.123442514694839e-07, 0.014581034132660431}},\n",
      "\tinitCacheKey{Approximation:\"sigmoid\", Version:\"N\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.4999999997037559, 0.2499957412799507, 0.05544062622341843, 0.006887644058850528, 0.00048485212592602815, 1.5645989044598313e-05}\n",
      "\t\tDenominatorCoefficients: []float64{-8.506532784269549e-06, 0.11088550238903279, -8.302465236326423e-07, 0.0009697677495734157}},\n",
      "\tinitCacheKey{Approximation:\"identity\", Version:\"A\", NumeratorDegree:3, DenominatorDegree:2}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{1.2892809281246332e-20, 1.000000000614517, 7.883537508306838e-12, 0.6183612729447092}\n",
      "\t\tDenominatorCoefficients: []float64{8.511708691315752e-10, 0.6183612726994397}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.03355815733452378, 0.5050059186781659, 1.6534697310952233, 2.0100501552600014, 0.9319195586484518, 0.15242646398275836}\n",
      "\t\tDenominatorCoefficients: []float64{4.812831860534153e-05, 3.9802479055059194, 1.5837587665720168e-05, 0.30183382839661377}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"A\", NumeratorDegree:7, DenominatorDegree:6}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.01007645697195976, 0.6317967788773284, 7.084951122518462, 28.513835912920452, 47.1330586589471, 37.7353261538062, 13.273737403073005, 1.7899654547972275}\n",
      "\t\tDenominatorCoefficients: []float64{3.825862317531991, 39.44222535222467, -30.642504274599432, 49.69365309008858, 9.223191325027036, 2.302627109817824}},\n",
      "\tinitCacheKey{Approximation:\"relu\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.029963801610813613, 0.6168978366891341, 2.37534759733888, 3.0659900472408443, 1.5246831881677423, 0.2528070864040542}\n",
      "\t\tDenominatorCoefficients: []float64{-1.191550121923625, 4.4080487697236626, 0.9110357113686055, 0.34884977946384615}},\n",
      "skipping \"Rational_version_C5/4.leaky_relu_0.1\"\n",
      "skipping \"Rational_version_B3/2.leaky_relu_0.1\"\n",
      "\tinitCacheKey{Approximation:\"tanh\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{2.1172949817857366e-09, 0.9999942495075363, 6.276332768876106e-07, 0.10770864506559906, 2.946556898117109e-08, 0.000871124373591946}\n",
      "\t\tDenominatorCoefficients: []float64{6.376908337817277e-07, 0.44101418051922986, 2.2747661404467182e-07, 0.014581039909092108}},\n",
      "skipping \"Rational_version_C3/2.leaky_relu_0.1\"\n",
      "\tinitCacheKey{Approximation:\"gelu\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-0.0004221071456647063, 0.49999955516606254, 0.40270535451115536, 0.07366976895222031, -0.012954788054484537, -0.0037414002583076983}\n",
      "\t\tDenominatorCoefficients: []float64{4.9585381197087913e-05, 0.1472977407631199, 1.1645825701440633e-05, -0.007483871514842074}},\n",
      "skipping \"Rational_version_B5/4.leaky_relu_0.1\"\n",
      "\tinitCacheKey{Approximation:\"identity\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0, 1, 0, 0, 0, 0}\n",
      "\t\tDenominatorCoefficients: []float64{0, 0, 0, 0}},\n",
      "\tinitCacheKey{Approximation:\"identity\", Version:\"A\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0, 1, 0, 0, 0, 0}\n",
      "\t\tDenominatorCoefficients: []float64{0, 0, 0, 0}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"N\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.0335582132067107, 0.505003740582471, 1.653458603975765, 2.010035526870634, 0.9319123754639458, 0.1524253263766341}\n",
      "\t\tDenominatorCoefficients: []float64{2.9474567624015346e-05, 3.9802415438832024, 5.162142903703752e-06, 0.3018331889980995}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"A\", NumeratorDegree:3, DenominatorDegree:2}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.11440311001189646, 0.5891610756805713, 0.5423986871505561, 0.13286948390430828}\n",
      "\t\tDenominatorCoefficients: []float64{0.2074994452826854, 0.20726656124953777}},\n",
      "\tinitCacheKey{Approximation:\"leaky_relu\", Version:\"B\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{0.03355815733452378, 0.5050059186781659, 1.6534697310952233, 2.0100501552600014, 0.9319195586484518, 0.15242646398275836}\n",
      "\t\tDenominatorCoefficients: []float64{4.812831860534153e-05, 3.9802479055059194, 1.5837587665720168e-05, 0.30183382839661377}},\n",
      "\tinitCacheKey{Approximation:\"tanh\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{9.143817420311582e-08, 46.87601105103956, 9.606864506795431e-05, 5.048980033620479, 4.469361939672058e-06, 0.04083504407681448}\n",
      "\t\tDenominatorCoefficients: []float64{46.77628057640709, 9.74704061164436e-05, 20.67310382546532, 3.473303618435723e-05, 0.6835046974230089}},\n",
      "\tinitCacheKey{Approximation:\"swish\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{9.623223463794738e-06, 14.75722171199872, 7.379106424221765, 1.5723856435823387, 0.17131862639152923, 0.008125189146807921}\n",
      "\t\tDenominatorCoefficients: []float64{29.41444303593795, 0.0011467081629387187, 3.144198880793362, 0.00011121774973276025, 0.016241982787967915}},\n",
      "skipping \"Rational_version_A3/2.leaky_relu_0.1\"\n",
      "\tinitCacheKey{Approximation:\"swish\", Version:\"D\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{3.2597006782059475e-07, 0.500000007624051, 0.2500169540800127, 0.05327519598927768, 0.005804580590860159, 0.00027529600705133663}\n",
      "\t\tDenominatorCoefficients: []float64{3.917294261258692e-05, 0.1065308384054887, 3.7991514117509955e-06, 0.0005503052126186067}},\n",
      "\tinitCacheKey{Approximation:\"sigmoid\", Version:\"C\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{9.292539203868202, 4.646322961463492, 1.0304346137104188, 0.12802035070214404, 0.009012006389028321, 0.000290782121558725}\n",
      "\t\tDenominatorCoefficients: []float64{18.485078400296143, 0.00010692547716301122, 2.0608158064816653, 1.0436027843534009e-05, 0.01802321462478323}},\n",
      "\tinitCacheKey{Approximation:\"swish\", Version:\"N\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{3.266881610395981e-07, 0.49999999081326113, 0.24997332715914988, 0.05325340025674068, 0.0058003403315322, 0.00027497533639232177}\n",
      "\t\tDenominatorCoefficients: []float64{-4.80777614312505e-05, 0.10653079960025053, -4.663835554309269e-06, 0.0005503029408021047}},\n",
      "\tinitCacheKey{Approximation:\"gelu\", Version:\"N\", NumeratorDegree:5, DenominatorDegree:4}: initCacheValue{\n",
      "\t\tNumeratorCoefficients: []float64{-0.001080882882487456, 0.5025161652007099, 0.6283336330558847, 0.2973720903550247, 0.06322520452943567, 0.005097017287773147}\n",
      "\t\tDenominatorCoefficients: []float64{0.44045431304569604, 0.24638482058938668, 0.08444750846536668, 0.0047540424624096115}},\n"
     ]
    }
   ],
   "source": [
    "import (\n",
    "    \"encoding/json\"\n",
    "    \"regexp\"\n",
    "    \"strconv\"\n",
    "\n",
    "    \"github.com/janpfeifer/must\"\n",
    "    \"github.com/gomlx/gomlx/pkg/ml/datasets\"\n",
    ")\n",
    "\n",
    "type CoefficientsConfig struct {\n",
    "    Numerator []float64 `json:\"init_w_numerator\"`\n",
    "    Denominator []float64 `json:\"init_w_denominator\"`\n",
    "    UpperBound float64 `json:\"ub\"`\n",
    "    LowerBound float64 `json:\"lb\"`\n",
    "}\n",
    "\n",
    "// RationalsConfig maps a version name and degrees configuration to its coefficients.\n",
    "type RationalsConfig map[string]CoefficientsConfig\n",
    "\n",
    "\n",
    "func parseRationalVersion(str string) (bool, string, int, int, string) {\n",
    "    re := regexp.MustCompile(`^Rational_version_([A-Z])(\\d+)/(\\d+).(\\w+)$`)\n",
    "    matches := re.FindStringSubmatch(str)\n",
    "\n",
    "    if matches == nil {\n",
    "        return false, \"\", 0, 0, \"\"\n",
    "    }\n",
    "\n",
    "    version := matches[1]\n",
    "    numerator, _ := strconv.Atoi(matches[2])\n",
    "    denominator, _ := strconv.Atoi(matches[3])\n",
    "    approxFunc := matches[4]\n",
    "\n",
    "    return true, version, numerator, denominator, approxFunc\n",
    "}\n",
    "\n",
    "func ConvertRationalsConfig(filePath string) {\n",
    "    filePath = must.M1(fsutil.ReplaceTildeInDir(filePath))\n",
    "    f := must.M1(os.Open(filePath))\n",
    "    defer f.Close()\n",
    "\n",
    "    config := make(RationalsConfig)\n",
    "    generic := make(map[string]json.RawMessage)\n",
    "    dec := json.NewDecoder(f)\n",
    "    must.M(dec.Decode(&generic))\n",
    "    for n1, raw1 := range generic {\n",
    "        var coef CoefficientsConfig\n",
    "        if err := json.Unmarshal(raw1, &coef); err == nil && len(coef.Numerator) > 0 {\n",
    "            // Take coefficients at level-1:\n",
    "            fmt.Printf(\"n1=%s -> %+v\\n\", n1, coef)\n",
    "            config[n1] = coef\n",
    "            continue\n",
    "        }\n",
    "        generic2 := make(map[string]json.RawMessage)\n",
    "        if err := json.Unmarshal(raw1, &generic2); err != nil {\n",
    "            fmt.Printf(\"Unknown format for JSON entry %q, skipping it.\\n\", n1)\n",
    "            continue\n",
    "        }\n",
    "        for n2, raw2 := range generic2 {\n",
    "            var coef2 CoefficientsConfig\n",
    "            name := n1+\".\"+n2\n",
    "            if err := json.Unmarshal(raw2, &coef2); err != nil {\n",
    "                fmt.Printf(\"Unknown format for JSON entry %q, skipping it.\\n\", name)\n",
    "                continue\n",
    "            }\n",
    "            config[name] = coef2\n",
    "        }\n",
    "    }\n",
    "    for configName, coef := range config {\n",
    "        valid, version, numeratorDegree, denominatorDegree, approx := parseRationalVersion(configName)\n",
    "        if !valid {\n",
    "            fmt.Printf(\"skipping %q\\n\", configName)\n",
    "            continue\n",
    "        }\n",
    "        fmt.Printf(\"\\tinitCacheKey{Approximation:%q, Version:%q, NumeratorDegree:%d, DenominatorDegree:%d}: initCacheValue{\\n\",\n",
    "                   approx, version, numeratorDegree, denominatorDegree)\n",
    "        fmt.Printf(\"\\t\\tNumeratorCoefficients: %#v\\n\\t\\tDenominatorCoefficients: %#v},\\n\", coef.Numerator, coef.Denominator)\n",
    "    }\n",
    "}\n",
    "\n",
    "%%\n",
    "// ConvertRationalsConfig(\"~/Downloads/rationals_config.json\")\n",
    "ConvertRationalsConfig(\"rationals_config.json\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Go (gonb)",
   "language": "go",
   "name": "gonb"
  },
  "language_info": {
   "codemirror_mode": "",
   "file_extension": ".go",
   "mimetype": "text/x-go",
   "name": "go",
   "nbconvert_exporter": "",
   "pygments_lexer": "",
   "version": "go1.25.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
